Fixed team changes and scoreboard bugs

This commit is contained in:
Daniel Simoes 2002-03-11 18:02:33 +00:00
parent 2029e4727a
commit 2ae2a9f8c0
3 changed files with 30 additions and 8 deletions

View file

@ -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 ) {

View file

@ -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,18 +97,21 @@ 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
@ -109,6 +119,7 @@ void G_ReadSessionData( gclient_t *client ) {
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__ */

View file

@ -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);