r176 - trunk/code/cgame

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Oct 23 13:18:23 EDT 2005


Author: tma
Date: 2005-10-23 13:18:23 -0400 (Sun, 23 Oct 2005)
New Revision: 176

Modified:
   trunk/code/cgame/cg_players.c
Log:
* Fix to https://bugzilla.icculus.org/show_bug.cgi?id=2401


Modified: trunk/code/cgame/cg_players.c
===================================================================
--- trunk/code/cgame/cg_players.c	2005-10-23 15:27:59 UTC (rev 175)
+++ trunk/code/cgame/cg_players.c	2005-10-23 17:18:23 UTC (rev 176)
@@ -649,11 +649,10 @@
 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 @@
 
 	// 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 @@
 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 @@
 			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 @@
 		// 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 @@
 	// we should never get here...
 	CG_Printf( "CG_SetDeferredClientInfo: no valid clients!\n" );
 
-	CG_LoadClientInfo( ci );
+	CG_LoadClientInfo( clientNum, ci );
 }
 
 
@@ -1037,14 +1035,14 @@
 		// 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 @@
 				ci->deferred = qfalse;
 				continue;
 			}
-			CG_LoadClientInfo( ci );
+			CG_LoadClientInfo( i, ci );
 //			break;
 		}
 	}




More information about the quake3-commits mailing list