From 69b81f2bd931053f335d2eda5fccb575187a3118 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 23 Oct 2005 17:18:23 +0000 Subject: [PATCH] * Fix to https://bugzilla.icculus.org/show_bug.cgi?id=2401 --- code/cgame/cg_players.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/code/cgame/cg_players.c b/code/cgame/cg_players.c index dd29fe2a..7ed3427e 100644 --- a/code/cgame/cg_players.c +++ b/code/cgame/cg_players.c @@ -649,11 +649,10 @@ Load it now, taking the disk hits. This will usually be deferred to a safe time =================== */ -static void CG_LoadClientInfo( clientInfo_t *ci ) { +static void CG_LoadClientInfo( int clientNum, clientInfo_t *ci ) { const char *dir, *fallback; int i, modelloaded; const char *s; - int clientNum; char teamname[MAX_QPATH]; teamname[0] = 0; @@ -726,7 +725,6 @@ static void CG_LoadClientInfo( clientInfo_t *ci ) { // reset any existing players and bodies, because they might be in bad // frames for this new model - clientNum = ci - cgs.clientinfo; for ( i = 0 ; i < MAX_GENTITIES ; i++ ) { if ( cg_entities[i].currentState.clientNum == clientNum && cg_entities[i].currentState.eType == ET_PLAYER ) { @@ -805,7 +803,7 @@ We aren't going to load it now, so grab some other client's info to use until we have some spare time. ====================== */ -static void CG_SetDeferredClientInfo( clientInfo_t *ci ) { +static void CG_SetDeferredClientInfo( int clientNum, clientInfo_t *ci ) { int i; clientInfo_t *match; @@ -824,7 +822,7 @@ static void CG_SetDeferredClientInfo( clientInfo_t *ci ) { continue; } // just load the real info cause it uses the same models and skins - CG_LoadClientInfo( ci ); + CG_LoadClientInfo( clientNum, ci ); return; } @@ -847,7 +845,7 @@ static void CG_SetDeferredClientInfo( clientInfo_t *ci ) { // an improper team skin. This will cause a hitch for the first // player, when the second enters. Combat shouldn't be going on // yet, so it shouldn't matter - CG_LoadClientInfo( ci ); + CG_LoadClientInfo( clientNum, ci ); return; } @@ -866,7 +864,7 @@ static void CG_SetDeferredClientInfo( clientInfo_t *ci ) { // we should never get here... CG_Printf( "CG_SetDeferredClientInfo: no valid clients!\n" ); - CG_LoadClientInfo( ci ); + CG_LoadClientInfo( clientNum, ci ); } @@ -1037,14 +1035,14 @@ void CG_NewClientInfo( int clientNum ) { // if we are defering loads, just have it pick the first valid if ( forceDefer || (cg_deferPlayers.integer && !cg_buildScript.integer && !cg.loading ) ) { // keep whatever they had if it won't violate team skins - CG_SetDeferredClientInfo( &newInfo ); + CG_SetDeferredClientInfo( clientNum, &newInfo ); // if we are low on memory, leave them with this model if ( forceDefer ) { CG_Printf( "Memory is low. Using deferred model.\n" ); newInfo.deferred = qfalse; } } else { - CG_LoadClientInfo( &newInfo ); + CG_LoadClientInfo( clientNum, &newInfo ); } } @@ -1077,7 +1075,7 @@ void CG_LoadDeferredPlayers( void ) { ci->deferred = qfalse; continue; } - CG_LoadClientInfo( ci ); + CG_LoadClientInfo( i, ci ); // break; } }