diff options
author | Tim Angus <tim@ngus.net> | 2001-02-02 02:05:01 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-02-02 02:05:01 +0000 |
commit | a08a8afb56a82cff489f82cdec1b802c76d0326e (patch) | |
tree | 5ac6c7fe67453222a9632684ef9f5ad2dc965c26 /src/cgame | |
parent | 4506d6a566309f62eb3db1bcf0d8b9a4fc4eaa1d (diff) |
Changed model precache system. A steaming pile of transnetwork bugfixes.
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_event.c | 7 | ||||
-rw-r--r-- | src/cgame/cg_players.c | 26 |
2 files changed, 16 insertions, 17 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 42ac22da..d5f30cb4 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -419,7 +419,7 @@ void CG_PainEvent( centity_t *cent, int health ) { CG_Menu ============== */ -void CG_Menu( centity_t *cent, int eventParm ) +void CG_Menu( int eventParm ) { switch( eventParm ) { @@ -448,7 +448,7 @@ void CG_Menu( centity_t *cent, int eventParm ) break; default: - Com_Printf( "cgame: debug: no such menu no %d\n", eventParm ); + Com_Printf( "cgame: debug: no such menu %d\n", eventParm ); } } @@ -981,7 +981,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) { case EV_MENU: DEBUGNAME("EV_MENU"); - CG_Menu( cent, es->eventParm ); + if( es->number == cg.clientNum ) + CG_Menu( es->eventParm ); break; default: diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index 680f544a..f2b1aaff 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -494,9 +494,12 @@ static void CG_CopyClientInfoModel( clientInfo_t *from, clientInfo_t *to ) { CG_GetCorpseNum ====================== */ -static int CG_GetCorpseNum( clientInfo_t *ci ) { - int i; +static int CG_GetCorpseNum( int pclass ) { + int i; clientInfo_t *match; + char *modelName; + + modelName = BG_FindModelNameForClass( pclass ); for ( i = 0 ; i < cgs.maxclients ; i++ ) { match = &cgs.corpseinfo[ i ]; @@ -506,15 +509,14 @@ static int CG_GetCorpseNum( clientInfo_t *ci ) { if ( match->deferred ) { continue; } - if ( !Q_stricmp( ci->modelName, match->modelName ) - && !Q_stricmp( ci->skinName, match->skinName ) ) { + if ( !Q_stricmp( modelName, match->modelName ) + /*&& !Q_stricmp( modelName, match->skinName )*/ ) { // this clientinfo is identical, so use it's handles - return i; } } - //something has gone badly wrong + //something has gone horribly wrong return -1; } @@ -1947,17 +1949,13 @@ void CG_Corpse( centity_t *cent ) float shadowPlane; //if this is the first time the function has been run set cent->corpseNum - if( cent->corpseNum < 1 ) + cent->corpseNum = CG_GetCorpseNum( cent->currentState.clientNum ); + if ( cent->corpseNum < 0 || cent->corpseNum >= MAX_CLIENTS ) { - ci = &cgs.clientinfo[ cent->currentState.clientNum ]; - cent->corpseNum = CG_GetCorpseNum( ci ) + 1; - if ( cent->corpseNum < 1 || cent->corpseNum >= MAX_CLIENTS + 1 ) - { - CG_Error( "Bad corpseNum on corpse entity: %d", cent->corpseNum ); - } + CG_Error( "Bad corpseNum on corpse entity: %d", cent->corpseNum ); } - ci = &cgs.corpseinfo[ cent->corpseNum - 1 ]; + ci = &cgs.corpseinfo[ cent->corpseNum ]; // it is possible to see corpses from disconnected players that may // not have valid clientinfo |