03 Feb 2010
This commit is contained in:
parent
44a60eb609
commit
be51439c5d
|
@ -70,6 +70,10 @@ typedef struct dllfunction_s
|
|||
gHUD.##y.UserCmd_##x( ); \
|
||||
}
|
||||
|
||||
// Use this to set any co-ords in 640x480 space
|
||||
#define XRES(x) ((int)(float(x) * ((float)ScreenWidth / 640.0f) + 0.5f))
|
||||
#define YRES(y) ((int)(float(y) * ((float)ScreenHeight / 480.0f) + 0.5f))
|
||||
|
||||
#define bound( min, num, max ) ((num) >= (min) ? ((num) < (max) ? (num) : (max)) : (min))
|
||||
|
||||
// ScreenHeight returns the virtual height of the screen, in pixels
|
||||
|
|
|
@ -719,7 +719,7 @@ void CHudAmmo::UserCmd_Close( void )
|
|||
gpActiveSel = NULL;
|
||||
CL_PlaySound( "common/wpn_hudoff.wav", 1.0f );
|
||||
}
|
||||
else CLIENT_COMMAND( "escape" );
|
||||
else CLIENT_COMMAND( "escape\n" );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ int CHudDeathNotice :: Draw( float flTime )
|
|||
|
||||
// Draw the death notice
|
||||
|
||||
y = DEATHNOTICE_TOP + (20 * i); //!!!
|
||||
y = YRES( DEATHNOTICE_TOP ) + 2 + (20 * i); //!!!
|
||||
|
||||
int id = (rgDeathNoticeList[i].iId == -1) ? m_HUD_d_skull : rgDeathNoticeList[i].iId;
|
||||
x = ScreenWidth - ConsoleStringLen(rgDeathNoticeList[i].szVictim) - (gHUD.GetSpriteRect(id).right - gHUD.GetSpriteRect(id).left);
|
||||
|
@ -112,8 +112,11 @@ int CHudDeathNotice :: Draw( float flTime )
|
|||
|
||||
x += (gHUD.GetSpriteRect( id ).right - gHUD.GetSpriteRect( id ).left );
|
||||
|
||||
// Draw victims name
|
||||
x = DrawConsoleString( x, y, rgDeathNoticeList[i].szVictim );
|
||||
// Draw victims name (if it was a player that was killed)
|
||||
if ( rgDeathNoticeList[i].iNonPlayerKill == FALSE )
|
||||
{
|
||||
x = DrawConsoleString( x, y, rgDeathNoticeList[i].szVictim );
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -153,6 +156,9 @@ int CHudDeathNotice :: MsgFunc_DeathMsg( const char *pszName, int iSize, void *p
|
|||
if( !killer_name ) killer_name = "";
|
||||
if( !victim_name ) victim_name = "";
|
||||
|
||||
strncpy( rgDeathNoticeList[i].szKiller, killer_name, MAX_PLAYER_NAME_LENGTH );
|
||||
strncpy( rgDeathNoticeList[i].szVictim, victim_name, MAX_PLAYER_NAME_LENGTH );
|
||||
|
||||
// Is it a non-player object kill?
|
||||
if ( ((char)victim) == -1 )
|
||||
{
|
||||
|
|
|
@ -119,6 +119,12 @@ int CHud :: MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf )
|
|||
pList = pList->pNext;
|
||||
}
|
||||
|
||||
// needs to clear any remaining screenfade
|
||||
ClearAllFades ();
|
||||
|
||||
// needs to clear any remaining soundfade
|
||||
CLIENT_COMMAND( "s_clearfade\n" );
|
||||
|
||||
// reset sensitivity
|
||||
m_flMouseSensitivity = 0;
|
||||
|
||||
|
|
|
@ -169,6 +169,8 @@ int CHudStatusBar :: Draw( float fTime )
|
|||
m_bReparseString = FALSE;
|
||||
}
|
||||
|
||||
int Y_START = ScreenHeight - YRES(32 + 4);
|
||||
|
||||
// Draw the status bar lines
|
||||
for ( int i = 0; i < MAX_STATUSBAR_LINES; i++ )
|
||||
{
|
||||
|
|
|
@ -59,14 +59,10 @@ void CL_DeltaEntity( sizebuf_t *msg, frame_t *frame, int newnum, entity_state_t
|
|||
if( state->number == MAX_EDICTS )
|
||||
{
|
||||
Com_Assert( newent );
|
||||
CL_FreeEdict( ent );
|
||||
if( !ent->free ) CL_FreeEdict( ent );
|
||||
return; // entity was delta removed
|
||||
}
|
||||
/*
|
||||
if( newent ) Msg( "Create entity %i\n", newnum );
|
||||
else if( !unchanged ) Msg( "Update entity %i\n", newnum );
|
||||
else Msg( "Unchanged entity %i\n", newnum );
|
||||
*/
|
||||
|
||||
cl.parse_entities++;
|
||||
frame->num_entities++;
|
||||
|
||||
|
|
|
@ -1305,7 +1305,7 @@ pfnClientCmd
|
|||
static void pfnClientCmd( const char *szCmdString )
|
||||
{
|
||||
// client command executes immediately
|
||||
Cmd_ExecuteString( szCmdString );
|
||||
Cbuf_AddText( szCmdString );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1488,8 +1488,8 @@ prints dirctly into console (can skip notify)
|
|||
static void pfnConsolePrint( const char *string )
|
||||
{
|
||||
if( !string || !*string ) return;
|
||||
if( *string == 1 ) Con_Print( string + 1 ); // show notify
|
||||
else Con_Print( va( "[skipnotify]%s", string )); // skip notify
|
||||
if( *string != 1 ) Con_Print( string ); // show notify
|
||||
else Con_Print( va( "[skipnotify]%s", string + 1 )); // skip notify
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -108,6 +108,35 @@ void CL_ForwardToServer_f( void )
|
|||
MSG_Print( &cls.netchan.message, Cmd_Args());
|
||||
}
|
||||
}
|
||||
/*
|
||||
===================
|
||||
Cmd_ForwardToServer
|
||||
|
||||
adds the current command line as a clc_stringcmd to the client message.
|
||||
things like godmode, noclip, etc, are commands directed to the server,
|
||||
so when they are typed in at the console, they will need to be forwarded.
|
||||
===================
|
||||
*/
|
||||
void Cmd_ForwardToServer( void )
|
||||
{
|
||||
char *cmd;
|
||||
|
||||
cmd = Cmd_Argv( 0 );
|
||||
if( cls.state <= ca_connected || *cmd == '-' || *cmd == '+' )
|
||||
{
|
||||
Msg( "Unknown command \"%s\"\n", cmd );
|
||||
return;
|
||||
}
|
||||
|
||||
MSG_WriteByte( &cls.netchan.message, clc_stringcmd );
|
||||
MSG_Print( &cls.netchan.message, cmd );
|
||||
|
||||
if( Cmd_Argc() > 1 )
|
||||
{
|
||||
MSG_Print( &cls.netchan.message, " " );
|
||||
MSG_Print( &cls.netchan.message, Cmd_Args( ));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
|
@ -312,8 +341,6 @@ void CL_ClearState( void )
|
|||
|
||||
Cvar_SetValue( "scr_download", 0.0f );
|
||||
Cvar_SetValue( "scr_loading", 0.0f );
|
||||
|
||||
UI_SetActiveMenu( UI_CLOSEMENU );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -352,6 +379,10 @@ void CL_Disconnect( void )
|
|||
}
|
||||
|
||||
cls.state = ca_disconnected;
|
||||
|
||||
// back to menu if developer mode set to "player" or "mapper"
|
||||
if( host.developer > 2 ) return;
|
||||
UI_SetActiveMenu( UI_MAINMENU );
|
||||
}
|
||||
|
||||
void CL_Disconnect_f( void )
|
||||
|
@ -911,6 +942,23 @@ void CL_Precache_f( void )
|
|||
CL_RequestNextDownload();
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CL_Escape_f
|
||||
|
||||
Escape to menu from game
|
||||
=================
|
||||
*/
|
||||
void CL_Escape_f( void )
|
||||
{
|
||||
if( cls.key_dest == key_menu )
|
||||
return;
|
||||
|
||||
if( cls.state == ca_cinematic )
|
||||
SCR_StopCinematic();
|
||||
else UI_SetActiveMenu( UI_MAINMENU );
|
||||
cls.key_dest = key_menu;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
|
@ -964,6 +1012,7 @@ void CL_InitLocal( void )
|
|||
Cmd_AddCommand ("movie", CL_PlayVideo_f, "playing a movie" );
|
||||
Cmd_AddCommand ("stop", CL_Stop_f, "stop playing or recording a demo" );
|
||||
Cmd_AddCommand ("info", NULL, "collect info about local servers with specified protocol" );
|
||||
Cmd_AddCommand ("escape", CL_Escape_f, "escape from game to menu" );
|
||||
|
||||
Cmd_AddCommand ("quit", CL_Quit_f, "quit from game" );
|
||||
Cmd_AddCommand ("exit", CL_Quit_f, "quit from game" );
|
||||
|
|
|
@ -348,6 +348,7 @@ void CL_ParseServerData( sizebuf_t *msg )
|
|||
|
||||
// wipe the client_t struct
|
||||
CL_ClearState();
|
||||
UI_SetActiveMenu( UI_CLOSEMENU );
|
||||
cls.state = ca_connected;
|
||||
|
||||
// parse protocol version number
|
||||
|
|
|
@ -315,6 +315,15 @@ trace_t CL_ClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3
|
|||
// did we clip the move?
|
||||
if( trace.flFraction < 1.0f || trace.fStartSolid )
|
||||
trace.pHit = ent;
|
||||
|
||||
if( !(flags & FTRACE_SIMPLEBOX) && CM_GetModelType( ent->v.modelindex ) == mod_studio )
|
||||
{
|
||||
if( VectorIsNull( mins ) && VectorIsNull( maxs ) && trace.iHitgroup == -1 )
|
||||
{
|
||||
trace.flFraction = 1.0f;
|
||||
trace.pHit = NULL; // clear entity when hitbox not intersected
|
||||
}
|
||||
}
|
||||
return trace;
|
||||
}
|
||||
|
||||
|
@ -372,7 +381,7 @@ static void CL_ClipToLinks( areanode_t *node, moveclip_t *clip )
|
|||
if( touch == clip->passedict )
|
||||
continue;
|
||||
if( touch->v.solid == SOLID_TRIGGER )
|
||||
Host_Error( "trigger in clipping list\n" );
|
||||
Host_Error( "Client: trigger in clipping list\n" );
|
||||
|
||||
if( clip->type == MOVE_NOMONSTERS && touch->v.solid != SOLID_BSP )
|
||||
continue;
|
||||
|
|
|
@ -242,6 +242,7 @@ char *Cvar_Userinfo( void );
|
|||
char *Cvar_Serverinfo( void );
|
||||
void Cmd_WriteVariables( file_t *f );
|
||||
bool Cmd_CheckMapsList( void );
|
||||
void Cmd_ForwardToServer( void );
|
||||
|
||||
typedef struct autocomplete_list_s
|
||||
{
|
||||
|
|
|
@ -1097,11 +1097,7 @@ void Key_Event( int key, bool down, int time )
|
|||
switch( cls.key_dest )
|
||||
{
|
||||
case key_game:
|
||||
if( cls.state == ca_cinematic )
|
||||
SCR_StopCinematic();
|
||||
else UI_SetActiveMenu( UI_MAINMENU );
|
||||
cls.key_dest = key_menu;
|
||||
return;
|
||||
break; // handled in client.dll
|
||||
case key_console:
|
||||
if( cls.state == ca_active )
|
||||
{
|
||||
|
@ -1124,7 +1120,9 @@ void Key_Event( int key, bool down, int time )
|
|||
|
||||
if( cls.key_dest == key_menu )
|
||||
{
|
||||
UI_KeyEvent( key, down );
|
||||
// only non printable keys passed
|
||||
if( key < 32 || key > 126 )
|
||||
UI_KeyEvent( key, down );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1209,10 +1207,15 @@ void CL_CharEvent( int key )
|
|||
if( key == '`' || key == '~' ) return;
|
||||
|
||||
// distribute the key down event to the apropriate handler
|
||||
if( cls.key_dest == key_console || cls.state == ca_disconnected )
|
||||
if( cls.key_dest == key_console )
|
||||
{
|
||||
Field_CharEvent( &g_consoleField, key );
|
||||
}
|
||||
else if( cls.key_dest == key_menu )
|
||||
{
|
||||
if( key >= 32 && key <= 126 )
|
||||
UI_KeyEvent( key, true );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -322,7 +322,7 @@ void IN_Frame( void )
|
|||
bool shutdownMouse = false;
|
||||
|
||||
// if at a full screen console, don't update unless needed
|
||||
if( host.state != HOST_FRAME || host.type == HOST_DEDICATED )
|
||||
if(( host.state != HOST_FRAME && CL_GetMaxClients() == 1 ) || host.type == HOST_DEDICATED )
|
||||
Sys_Sleep( 20 );
|
||||
|
||||
if( !in_mouseinitialized )
|
||||
|
|
|
@ -553,7 +553,7 @@ int Host_ModifyTime( int msec )
|
|||
{
|
||||
// clients of remote servers do not want to clamp time, because
|
||||
// it would skew their view of the server's time temporarily
|
||||
clamp_time = 5000;
|
||||
clamp_time = 200;
|
||||
}
|
||||
|
||||
if( msec > clamp_time ) msec = clamp_time;
|
||||
|
@ -900,6 +900,7 @@ launch_exp_t DLLEXPORT *CreateAPI( stdlib_api_t *input, void *unused )
|
|||
Host.Main = Host_Main;
|
||||
Host.Free = Host_Free;
|
||||
Host.CPrint = Host_Print;
|
||||
Host.CmdForward = Cmd_ForwardToServer;
|
||||
|
||||
return &Host;
|
||||
}
|
|
@ -351,6 +351,7 @@ void SV_BroadcastCommand( char *fmt, ... );
|
|||
// sv_client.c
|
||||
//
|
||||
char *SV_StatusString( void );
|
||||
void SV_RefreshUserinfo( void );
|
||||
void SV_GetChallenge( netadr_t from );
|
||||
void SV_DirectConnect( netadr_t from );
|
||||
void SV_TogglePause( const char *msg );
|
||||
|
|
|
@ -321,6 +321,9 @@ void SV_DropClient( sv_client_t *drop )
|
|||
svgame.dllFuncs.pfnSpectatorDisconnect( drop->edict );
|
||||
else svgame.dllFuncs.pfnClientDisconnect( drop->edict );
|
||||
|
||||
SV_RefreshUserinfo(); // refresh userinfo on disconnect
|
||||
drop->edict->pvServerData->s.ed_type = ED_STATIC; // remove from server
|
||||
|
||||
// SV_FreeEdict( drop->edict );
|
||||
if( drop->download ) drop->download = NULL;
|
||||
|
||||
|
@ -582,6 +585,15 @@ void SV_FullClientUpdate( sv_client_t *cl, sizebuf_t *msg )
|
|||
MSG_Clear( msg );
|
||||
}
|
||||
|
||||
void SV_RefreshUserinfo( void )
|
||||
{
|
||||
int i;
|
||||
sv_client_t *cl;
|
||||
|
||||
for( i = 0, cl = svs.clients; i < sv_maxclients->integer; i++, cl++ )
|
||||
if( cl->state >= cs_connected && !(cl->edict && cl->edict->v.flags & FL_FAKECLIENT ))
|
||||
cl->sendinfo = true;
|
||||
}
|
||||
/*
|
||||
===========
|
||||
PutClientInServer
|
||||
|
@ -624,7 +636,7 @@ void SV_PutClientInServer( edict_t *ent )
|
|||
const char *model = Info_ValueForKey( client->userinfo, "model" );
|
||||
|
||||
// apply custom playermodel
|
||||
if( com.strlen( model ))
|
||||
if( com.strlen( model ) && com.stricmp( model, "player" ))
|
||||
{
|
||||
const char *path = va( "models/player/%s/%s.mdl", model, model );
|
||||
CM_RegisterModel( path, SV_ModelIndex( path )); // register model
|
||||
|
@ -635,12 +647,11 @@ void SV_PutClientInServer( edict_t *ent )
|
|||
ent->v.netname = MAKE_STRING(Info_ValueForKey( client->userinfo, "name" ));
|
||||
}
|
||||
else ent->v.netname = MAKE_STRING( "player" );
|
||||
ent->v.view_ofs[2] = GI->viewheight[0];
|
||||
|
||||
// fisrt entering
|
||||
svgame.dllFuncs.pfnClientPutInServer( ent );
|
||||
|
||||
ent->v.view_ofs[2] = GI->viewheight[0];
|
||||
ent->v.viewangles[ROLL] = 0; // cut off any camera rolling
|
||||
ent->v.origin[2] -= GI->client_mins[2][2]; // FIXME: make sure off ground
|
||||
|
||||
SV_BaselineForEntity( ent );
|
||||
|
@ -735,7 +746,7 @@ void SV_New_f( sv_client_t *cl )
|
|||
MSG_WriteString( &cl->netchan.message, STRING( EDICT_NUM( 0 )->v.message )); // Map Message
|
||||
|
||||
// refresh userinfo on spawn
|
||||
cl->sendinfo = true;
|
||||
SV_RefreshUserinfo();
|
||||
|
||||
// game server
|
||||
if( sv.state == ss_active )
|
||||
|
|
|
@ -63,6 +63,12 @@ void SV_UpdateEntityState( const edict_t *ent, bool baseline )
|
|||
MSG_WriteAngle32( &sv.multicast, 0 );
|
||||
MSG_DirectSend( MSG_ONE, vec3_origin, client->edict );
|
||||
}
|
||||
|
||||
if( client->modelindex )
|
||||
{
|
||||
// apply custom model if set
|
||||
((edict_t *)ent)->v.modelindex = client->modelindex;
|
||||
}
|
||||
}
|
||||
|
||||
svgame.dllFuncs.pfnUpdateEntityState( &ent->pvServerData->s, (edict_t *)ent, baseline );
|
||||
|
@ -70,11 +76,6 @@ void SV_UpdateEntityState( const edict_t *ent, bool baseline )
|
|||
if( client )
|
||||
{
|
||||
client->edict->v.fixangle = false;
|
||||
if( client->modelindex )
|
||||
{
|
||||
// apply custom model if set
|
||||
ent->pvServerData->s.modelindex = client->modelindex;
|
||||
}
|
||||
}
|
||||
// always keep an actual
|
||||
ent->pvServerData->s.number = ent->serialnumber;
|
||||
|
|
|
@ -361,6 +361,16 @@ trace_t SV_ClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3
|
|||
// did we clip the move?
|
||||
if( trace.flFraction < 1.0f || trace.fStartSolid )
|
||||
trace.pHit = ent;
|
||||
|
||||
if( !(flags & FTRACE_SIMPLEBOX) && CM_GetModelType( ent->v.modelindex ) == mod_studio )
|
||||
{
|
||||
if( VectorIsNull( mins ) && VectorIsNull( maxs ) && trace.iHitgroup == -1 )
|
||||
{
|
||||
trace.flFraction = 1.0f;
|
||||
trace.pHit = NULL; // clear entity when hitbox not intersected
|
||||
}
|
||||
}
|
||||
|
||||
return trace;
|
||||
}
|
||||
|
||||
|
@ -418,7 +428,7 @@ static void SV_ClipToLinks( areanode_t *node, moveclip_t *clip )
|
|||
if( touch == clip->passedict )
|
||||
continue;
|
||||
if( touch->v.solid == SOLID_TRIGGER )
|
||||
Host_Error( "trigger in clipping list\n" );
|
||||
Host_Error( "Server: trigger in clipping list\n" );
|
||||
|
||||
if( clip->type == MOVE_NOMONSTERS && touch->v.solid != SOLID_BSP )
|
||||
continue;
|
||||
|
|
|
@ -101,6 +101,8 @@ static void UI_CreateGame_GetMapsList( void )
|
|||
// create new maplist if not exist
|
||||
if( !Cmd_CheckMapsList() || (script = Com_OpenScript( "scripts/maps.lst", NULL, 0 )) == NULL )
|
||||
{
|
||||
uiCreateGame.done.generic.flags |= QMF_GRAYED;
|
||||
uiCreateGame.mapsList.itemNames = uiCreateGame.mapsDescriptionPtr;
|
||||
MsgDev( D_ERROR, "Cmd_GetMapsList: can't open maps.lst\n" );
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ static void UI_CustomGame_GetModList( void )
|
|||
uiCustomGame.modList.itemNames = uiCustomGame.modsDescriptionPtr;
|
||||
|
||||
// see if the load button should be grayed
|
||||
if( !com.stricmp( GI->gamefolder, uiCustomGame.modsDir[0] ))
|
||||
if( !com.stricmp( GI->gamefolder, uiCustomGame.modsDir[uiCustomGame.modList.curItem] ))
|
||||
uiCustomGame.load.generic.flags |= QMF_GRAYED;
|
||||
if( com.strlen( uiCustomGame.modsWebSites[0] ) == 0 )
|
||||
uiCustomGame.go2url.generic.flags |= QMF_GRAYED;
|
||||
|
|
|
@ -1184,8 +1184,9 @@ const char *UI_Field_Key( menuField_s *f, int key, bool down )
|
|||
}
|
||||
|
||||
// Next character
|
||||
if (key == K_RIGHTARROW){
|
||||
if (f->cursor < f->length)
|
||||
if( key == K_RIGHTARROW )
|
||||
{
|
||||
if( f->cursor < f->length )
|
||||
f->cursor++;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -588,10 +588,10 @@ void Cmd_ExecuteString( const char *text )
|
|||
// check cvars
|
||||
if( Cvar_Command()) return;
|
||||
|
||||
if( Sys.app_name == HOST_NORMAL )
|
||||
if( Sys.app_name == HOST_NORMAL && Sys.CmdFwd )
|
||||
{
|
||||
// all unrecognized commands will be forwarded to a server
|
||||
Cmd_ExecuteString( va( "cmd %s", text ));
|
||||
Sys.CmdFwd();
|
||||
}
|
||||
else Msg( "Unknown command \"%s\"\n", text );
|
||||
}
|
||||
|
|
|
@ -81,6 +81,7 @@ typedef struct system_s
|
|||
void ( *Main ) ( void ); // host frame
|
||||
void ( *Free ) ( void ); // close host
|
||||
void (*CPrint)( const char *msg ); // console print
|
||||
void (*CmdFwd)( void ); // forward to server
|
||||
} system_t;
|
||||
|
||||
typedef struct timer_s
|
||||
|
|
|
@ -426,6 +426,7 @@ void Sys_CreateInstance( void )
|
|||
Sys.Main = Host->Main;
|
||||
Sys.Free = Host->Free;
|
||||
Sys.CPrint = Host->CPrint;
|
||||
Sys.CmdFwd = Host->CmdForward;
|
||||
if( baserc_dll.link )
|
||||
{
|
||||
CreateBaserc = (void *)baserc_dll.main;
|
||||
|
|
|
@ -73,6 +73,7 @@ typedef struct launch_exp_s
|
|||
void (*Main)( void ); // host frame
|
||||
void (*Free)( void ); // close host
|
||||
void (*CPrint)( const char *msg ); // host print
|
||||
void (*CmdForward)( void ); // cmd forward to server
|
||||
} launch_exp_t;
|
||||
|
||||
#endif//ENGINE_API_H
|
|
@ -595,7 +595,6 @@ void CBaseBrush::Die( void )
|
|||
pev->solid = SOLID_NOT;
|
||||
UTIL_FireTargets( pev->target, NULL, NULL, USE_TOGGLE );
|
||||
pev->target = 0;
|
||||
Msg("Fire!\n");
|
||||
SetThink( Remove );
|
||||
SetNextThink( 0.1 );
|
||||
|
||||
|
|
|
@ -376,26 +376,25 @@ void CBaseEntity::FireBullets(ULONG cShots, Vector vecSrc, Vector vecDirShooting
|
|||
// get circular gaussian spread
|
||||
float x, y, z;
|
||||
do {
|
||||
x = RANDOM_FLOAT(-0.5,0.5) + RANDOM_FLOAT(-0.5,0.5);
|
||||
y = RANDOM_FLOAT(-0.5,0.5) + RANDOM_FLOAT(-0.5,0.5);
|
||||
x = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f );
|
||||
y = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f );
|
||||
z = x*x+y*y;
|
||||
} while (z > 1);
|
||||
} while ( z > 1 );
|
||||
|
||||
Vector vecDir = vecDirShooting +
|
||||
x * vecSpread.x * vecRight +
|
||||
y * vecSpread.y * vecUp;
|
||||
Vector vecDir = vecDirShooting + x * vecSpread.x * vecRight + y * vecSpread.y * vecUp;
|
||||
Vector vecEnd;
|
||||
|
||||
vecEnd = vecSrc + vecDir * flDistance;
|
||||
UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(pev)/*pentIgnore*/, &tr);
|
||||
UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( pev )/*pentIgnore*/, &tr );
|
||||
|
||||
tracer = 0;
|
||||
if (iTracerFreq != 0 && (tracerCount++ % iTracerFreq) == 0)
|
||||
if( iTracerFreq != 0 && (tracerCount++ % iTracerFreq) == 0 )
|
||||
{
|
||||
Vector vecTracerSrc;
|
||||
|
||||
if ( IsPlayer() )
|
||||
{// adjust tracer position for player
|
||||
{
|
||||
// adjust tracer position for player
|
||||
vecTracerSrc = vecSrc + Vector ( 0 , 0 , -4 ) + gpGlobals->v_right * 2 + gpGlobals->v_forward * 16;
|
||||
}
|
||||
else
|
||||
|
@ -428,9 +427,9 @@ void CBaseEntity::FireBullets(ULONG cShots, Vector vecSrc, Vector vecDirShooting
|
|||
}
|
||||
}
|
||||
// do damage, paint decals
|
||||
if (tr.flFraction != 1.0)
|
||||
if ( tr.flFraction != 1.0 )
|
||||
{
|
||||
CBaseEntity *pEntity = CBaseEntity::Instance(tr.pHit);
|
||||
CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit );
|
||||
|
||||
if ( iDamage )
|
||||
{
|
||||
|
|
|
@ -593,7 +593,7 @@ CNukeExplode *CNukeExplode::Create ( Vector vecOrigin, CBaseEntity *pOwner )
|
|||
pNuke->pev->origin = vecOrigin;
|
||||
pNuke->Spawn();
|
||||
pNuke->pev->classname = MAKE_STRING( "nuclear_explode" );
|
||||
pNuke->pev->owner = pOwner->edict();
|
||||
pNuke->pevOwner = pOwner->pev;
|
||||
|
||||
return pNuke;
|
||||
}
|
||||
|
@ -640,9 +640,6 @@ void CNukeExplode :: ExplodeThink( void )
|
|||
if( pev->scale >= 8 && pev->scale < 8.2 ) // create second explode sprite
|
||||
SFX_Explode( m_usExplodeSprite2, pev->oldorigin, 100, TE_EXPLFLAG_NOPARTICLES|TE_EXPLFLAG_NOSOUND );
|
||||
|
||||
entvars_t *pevOwner;
|
||||
if( pev->owner ) pevOwner = VARS( pev->owner );
|
||||
else pevOwner = NULL;
|
||||
pev->owner = NULL; // can't traceline attack owner if this is set
|
||||
|
||||
::RadiusDamage( pev->origin, pev, pevOwner, pev->renderamt/2, pev->scale * 30, CLASS_NONE, DMG_BLAST|DMG_NUCLEAR );
|
||||
|
|
|
@ -70,6 +70,7 @@ public:
|
|||
static CNukeExplode *Create ( Vector vecOrigin, CBaseEntity *pOwner );
|
||||
short m_usExplodeSprite;
|
||||
short m_usExplodeSprite2;
|
||||
entvars_t *pevOwner; // keep pointer to rocket owner
|
||||
};
|
||||
|
||||
class CWHRocket : public CBaseAnimating
|
||||
|
|
|
@ -196,7 +196,7 @@ void ClientDisconnect( edict_t *pEntity )
|
|||
// called by ClientKill and DeadThink
|
||||
void respawn(entvars_t* pev, BOOL fCopyCorpse)
|
||||
{
|
||||
if (gpGlobals->coop || gpGlobals->deathmatch)
|
||||
if ( gpGlobals->teamplay || gpGlobals->coop || gpGlobals->deathmatch )
|
||||
{
|
||||
if ( fCopyCorpse )
|
||||
{
|
||||
|
@ -208,8 +208,9 @@ void respawn(entvars_t* pev, BOOL fCopyCorpse)
|
|||
GetClassPtr( (CBasePlayer *)pev)->Spawn( );
|
||||
}
|
||||
else
|
||||
{ // restart the entire server
|
||||
SERVER_COMMAND("reload\n");
|
||||
{
|
||||
// restart the entire server
|
||||
SERVER_COMMAND( "reload\n" );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,6 +264,7 @@ void ClientPutInServer( edict_t *pEntity )
|
|||
|
||||
// Reset interpolation during first frame
|
||||
pPlayer->pev->effects |= EF_NOINTERP;
|
||||
pPlayer->m_flViewHeight = pPlayer->pev->view_ofs.z; // keep viewheight an actual
|
||||
|
||||
g_startSuit = FALSE;
|
||||
}
|
||||
|
|
|
@ -1264,21 +1264,21 @@ void CBasePlayer::PlayerDeathThink(void)
|
|||
WRITE_BYTE( 0 );
|
||||
MESSAGE_END();
|
||||
|
||||
if (pev->modelindex && (!m_fSequenceFinished) && (pev->deadflag == DEAD_DYING))
|
||||
if( pev->modelindex && (!m_fSequenceFinished) && ( pev->deadflag == DEAD_DYING ))
|
||||
{
|
||||
StudioFrameAdvance( );
|
||||
|
||||
m_iRespawnFrames++; // Note, these aren't necessarily real "frames", so behavior is dependent on # of client movement commands
|
||||
m_iRespawnFrames++; // Note, these aren't necessarily real "frames", so behavior is dependent on # of client movement commands
|
||||
if ( m_iRespawnFrames < 120 ) // Animations should be no longer than this
|
||||
return;
|
||||
}
|
||||
|
||||
// once we're done animating our death and we're on the ground, we want to set movetype to None so our dead body won't do collisions and stuff anymore
|
||||
// this prevents a bug where the dead body would go to a player's head if he walked over it while the dead player was clicking their button to respawn
|
||||
if ( pev->movetype != MOVETYPE_NONE && FBitSet(pev->flags, FL_ONGROUND) )
|
||||
if ( pev->movetype != MOVETYPE_NONE && FBitSet( pev->flags, FL_ONGROUND ))
|
||||
pev->movetype = MOVETYPE_NONE;
|
||||
|
||||
if (pev->deadflag == DEAD_DYING)
|
||||
if ( pev->deadflag == DEAD_DYING )
|
||||
pev->deadflag = DEAD_DEAD;
|
||||
|
||||
StopAnimation();
|
||||
|
@ -1322,7 +1322,9 @@ void CBasePlayer::PlayerDeathThink(void)
|
|||
|
||||
//ALERT(at_console, "Respawn\n");
|
||||
|
||||
respawn(pev, !(m_afPhysicsFlags & PFLAG_OBSERVER) );// don't copy a corpse if we're in deathcam.
|
||||
respawn(pev, !(m_afPhysicsFlags & PFLAG_OBSERVER) ); // don't copy a corpse if we're in deathcam.
|
||||
pev->view_ofs.z = m_flViewHeight; // restore viewheight on respawn
|
||||
|
||||
DontThink();
|
||||
}
|
||||
|
||||
|
@ -2724,6 +2726,8 @@ void CBasePlayer::Spawn( void )
|
|||
pev->renderfx = 0;
|
||||
pev->rendercolor = g_vecZero;
|
||||
pev->mass = 90; // lbs
|
||||
pev->viewangles.z = 0; // cut off any camera rolling
|
||||
pev->view_ofs.z;
|
||||
m_bitsHUDDamage = -1;
|
||||
m_bitsDamageType = 0;
|
||||
m_afPhysicsFlags = 0;
|
||||
|
@ -2789,6 +2793,9 @@ void CBasePlayer::Spawn( void )
|
|||
ALERT ( at_console, "Couldn't alloc player sound slot!\n" );
|
||||
}
|
||||
|
||||
// remove any sound fading
|
||||
g_engfuncs.pfnFadeClientVolume( edict(), 0, 0, 0, 0 );
|
||||
|
||||
m_fNoPlayerSound = FALSE;// normal sound behavior.
|
||||
|
||||
m_pLastItem = NULL;
|
||||
|
@ -2848,7 +2855,7 @@ void CBasePlayer :: Precache( void )
|
|||
if ( gInitHUD ) m_fInitHUD = TRUE;
|
||||
rainNeedsUpdate = 1;
|
||||
|
||||
//clear fade effects
|
||||
// clear fade effects
|
||||
if( IsMultiplayer( ))
|
||||
{
|
||||
m_FadeColor = Vector( 255, 255, 255 );
|
||||
|
|
|
@ -153,6 +153,7 @@ public:
|
|||
float m_fDeadTime; // the time at which the player died (used in PlayerDeathThink())
|
||||
float m_fAirFinished; // moved here from progdefs.h
|
||||
float m_fPainFinished; // moved here from progdefs.h
|
||||
float m_flViewHeight; // keep value from view_ofs.z that engine sets it when player first entering in multiplayer
|
||||
|
||||
BOOL m_fNoPlayerSound; // a debugging feature. Player makes no sound if this is true.
|
||||
BOOL m_fLongJump; // does this player have the longjump module?
|
||||
|
|
|
@ -846,6 +846,17 @@ void S_StopSound_f( void )
|
|||
S_StopAllSounds();
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
S_ClearFade_f
|
||||
=================
|
||||
*/
|
||||
void S_ClearFade_f( void )
|
||||
{
|
||||
// clear any remaining soundfade
|
||||
Mem_Set( &soundfade, 0, sizeof( soundfade ));
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
S_SoundInfo_f
|
||||
|
@ -897,8 +908,9 @@ bool S_Init( void *hInst )
|
|||
s_room_type = Cvar_Get( "room_type", "0", 0, "dsp room type" );
|
||||
|
||||
Cmd_AddCommand( "playsound", S_PlaySound_f, "playing a specified sound file" );
|
||||
Cmd_AddCommand( "stopsound", S_StopSound_f, "stop all sounds" );
|
||||
Cmd_AddCommand( "music", S_Music_f, "starting a background track" );
|
||||
Cmd_AddCommand( "s_stop", S_StopSound_f, "stop all sounds" );
|
||||
Cmd_AddCommand( "s_clearfade", S_ClearFade_f, "clear any sound fade" );
|
||||
Cmd_AddCommand( "s_info", S_SoundInfo_f, "print sound system information" );
|
||||
Cmd_AddCommand( "soundlist", S_SoundList_f, "display loaded sounds" );
|
||||
|
||||
|
@ -945,6 +957,7 @@ void S_Shutdown( void )
|
|||
Cmd_RemoveCommand( "music" );
|
||||
Cmd_RemoveCommand( "s_stop" );
|
||||
Cmd_RemoveCommand( "s_info" );
|
||||
Cmd_RemoveCommand( "s_clearfade" );
|
||||
Cmd_RemoveCommand( "soundlist" );
|
||||
|
||||
if( !al_state.initialized )
|
||||
|
|
|
@ -821,6 +821,17 @@ void S_StopSound_f( void )
|
|||
S_StopAllSounds();
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
S_ClearFade_f
|
||||
=================
|
||||
*/
|
||||
void S_ClearFade_f( void )
|
||||
{
|
||||
// clear any remaining soundfade
|
||||
Mem_Set( &soundfade, 0, sizeof( soundfade ));
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
S_SoundInfo_f
|
||||
|
@ -869,6 +880,7 @@ bool S_Init( void *hInst )
|
|||
Cmd_AddCommand( "playsound", S_Play_f, "playing a specified sound file" );
|
||||
Cmd_AddCommand( "stopsound", S_StopSound_f, "stop all sounds" );
|
||||
Cmd_AddCommand( "soundlist", S_SoundList_f, "display loaded sounds" );
|
||||
Cmd_AddCommand( "s_clearfade", S_ClearFade_f, "clear any sound fade" );
|
||||
Cmd_AddCommand( "s_info", S_SoundInfo_f, "print sound system information" );
|
||||
|
||||
if( !host_sound->integer )
|
||||
|
@ -903,6 +915,7 @@ void S_Shutdown( void )
|
|||
Cmd_RemoveCommand( "playsound" );
|
||||
Cmd_RemoveCommand( "stopsound" );
|
||||
Cmd_RemoveCommand( "soundlist" );
|
||||
Cmd_RemoveCommand( "s_clearfade" );
|
||||
Cmd_RemoveCommand( "s_info" );
|
||||
|
||||
if( !sound_started ) return;
|
||||
|
|
|
@ -2047,7 +2047,7 @@ static bool R_StudioSetupModel( ref_entity_t *e, ref_model_t *mod )
|
|||
{
|
||||
// prepare to draw dead player
|
||||
m_pEntity = ri.GetClientEdict( e->renderamt );
|
||||
e->gaitsequence = 0;
|
||||
m_pEntity->v.gaitsequence = 0;
|
||||
}
|
||||
|
||||
if( !m_pEntity ) return 0;
|
||||
|
|
Reference in New Issue