From 2ae2a9f8c0564cba0c1e19607cbd7878cba5e096 Mon Sep 17 00:00:00 2001 From: Daniel Simoes Date: Mon, 11 Mar 2002 18:02:33 +0000 Subject: [PATCH] Fixed team changes and scoreboard bugs --- reaction/game/g_client.c | 7 +++++++ reaction/game/g_session.c | 23 +++++++++++++++++------ reaction/game/g_teamplay.c | 8 ++++++-- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/reaction/game/g_client.c b/reaction/game/g_client.c index f36153ec..bf7f6a15 100644 --- a/reaction/game/g_client.c +++ b/reaction/game/g_client.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.47 2002/03/11 18:02:33 slicer +// Fixed team changes and scoreboard bugs +// // Revision 1.46 2002/03/07 01:38:36 assimon // Changed Ref System. New cvar added - g_RQ3_RefID. Now referee is peserved even on map changes or map_restarts. // @@ -1135,7 +1138,11 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) { // get and distribute relevent paramters G_LogPrintf( "ClientConnect: %i\n", clientNum ); + + //slicer : make sessionTeam = to savedTeam for scoreboard on cgame + client->sess.sessionTeam = client->sess.savedTeam ; ClientUserinfoChanged( clientNum ); + client->sess.sessionTeam = TEAM_SPECTATOR; // don't do the "xxx connected" messages if they were caried over from previous level if ( firstTime ) { diff --git a/reaction/game/g_session.c b/reaction/game/g_session.c index 1f7121fc..cc3df6d8 100644 --- a/reaction/game/g_session.c +++ b/reaction/game/g_session.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.10 2002/03/11 18:02:33 slicer +// Fixed team changes and scoreboard bugs +// // Revision 1.9 2002/02/25 19:41:53 jbravo // Fixed the use ESC and join menu to join teams when dead players are // spectating in TP mode. @@ -56,14 +59,18 @@ void G_WriteClientSessionData( gclient_t *client ) { const char *s; const char *var; - s = va("%i %i %i %i %i %i %i", + //Slicer how about savedTeam ?! + + s = va("%i %i %i %i %i %i %i %i", client->sess.sessionTeam, client->sess.spectatorTime, client->sess.spectatorState, client->sess.spectatorClient, client->sess.wins, client->sess.losses, - client->sess.teamLeader + client->sess.teamLeader, + //Adding saved Team + client->sess.savedTeam ); var = va( "session%i", client - level.clients ); @@ -90,25 +97,29 @@ void G_ReadSessionData( gclient_t *client ) { int teamLeader; int spectatorState; int sessionTeam; + //Slicer + int savedTeam; var = va( "session%i", client - level.clients ); trap_Cvar_VariableStringBuffer( var, s, sizeof(s) ); - - sscanf( s, "%i %i %i %i %i %i %i", +//Slicer: Reading savedTeam also. + sscanf( s, "%i %i %i %i %i %i %i %i", &sessionTeam, // bk010221 - format &client->sess.spectatorTime, &spectatorState, // bk010221 - format &client->sess.spectatorClient, &client->sess.wins, &client->sess.losses, - &teamLeader // bk010221 - format + &teamLeader, // bk010221 - format + &savedTeam ); // bk001205 - format issues client->sess.sessionTeam = (team_t)sessionTeam; client->sess.spectatorState = (spectatorState_t)spectatorState; client->sess.teamLeader = (qboolean)teamLeader; - + + client->sess.savedTeam = (team_t)savedTeam; #ifdef __ZCAM__ camera_state_load (client); #endif /* __ZCAM__ */ diff --git a/reaction/game/g_teamplay.c b/reaction/game/g_teamplay.c index 708c6b0d..76195fec 100644 --- a/reaction/game/g_teamplay.c +++ b/reaction/game/g_teamplay.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.31 2002/03/11 18:02:33 slicer +// Fixed team changes and scoreboard bugs +// // Revision 1.30 2002/03/07 14:29:12 slicer // Intermission ala aq2, when timelimit/roundlimit hits. // @@ -798,8 +801,9 @@ void MakeSpectator( gentity_t *ent ) client->weaponCount[ent->client->ps.weapon] = 0; client->ps.stats[STAT_WEAPONS] = 0; - client->sess.savedTeam = client->sess.sessionTeam; - client->ps.persistant[PERS_SAVEDTEAM] = client->sess.sessionTeam; + //Slicer, commenting this, fixes a lot..savedTeam is always accurate, no need to change it here +// client->sess.savedTeam = client->sess.sessionTeam; +// client->ps.persistant[PERS_SAVEDTEAM] = client->sess.sessionTeam; client->sess.sessionTeam = TEAM_SPECTATOR; client->ps.persistant[PERS_TEAM] = TEAM_SPECTATOR; ClientSpawn(ent);