diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_local.h | 2 | ||||
-rw-r--r-- | src/game/g_team.c | 17 | ||||
-rw-r--r-- | src/qcommon/q_shared.h | 2 |
3 files changed, 10 insertions, 11 deletions
diff --git a/src/game/g_local.h b/src/game/g_local.h index 2163df4..522bdb7 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -354,8 +354,6 @@ typedef struct char voice[ MAX_VOICE_NAME_LEN ]; qboolean useUnlagged; - // team change tracking - team_t newTeam; // keep track of other players' info for tinfo char cinfo[ MAX_CLIENTS ][ 16 ]; } clientPersistant_t; diff --git a/src/game/g_team.c b/src/game/g_team.c index a89d043..cea0b25 100644 --- a/src/game/g_team.c +++ b/src/game/g_team.c @@ -166,7 +166,7 @@ void G_UpdateTeamConfigStrings( void ) G_LeaveTeam ================== */ -void G_LeaveTeam( gentity_t *self ) +void G_LeaveTeamReal( gentity_t *self, qboolean reset_score ) { team_t team = self->client->pers.teamSelection; gentity_t *ent; @@ -174,12 +174,12 @@ void G_LeaveTeam( gentity_t *self ) if( team == TEAM_ALIENS ) { G_RemoveFromSpawnQueue( &level.alienSpawnQueue, self->client->ps.clientNum ); - if ( ( self->client->pers.newTeam == TEAM_NONE ) && !level.intermissiontime ) { + if ( reset_score && !level.intermissiontime ) { G_admin_reset_score( self ); } } else if( team == TEAM_HUMANS ) { G_RemoveFromSpawnQueue( &level.humanSpawnQueue, self->client->ps.clientNum ); - if ( ( self->client->pers.newTeam == TEAM_NONE ) && !level.intermissiontime ) { + if ( reset_score && !level.intermissiontime ) { G_admin_reset_score( self ); } } else { @@ -224,11 +224,14 @@ void G_LeaveTeam( gentity_t *self ) G_namelog_update_score( self->client ); - ent->client->pers.newTeam = TEAM_NONE; - admin_writeconfig(); } +void G_LeaveTeam( gentity_t *self ) +{ + G_LeaveTeamReal( self, qtrue ); +} + /* ================= G_ChangeTeam @@ -241,9 +244,7 @@ void G_ChangeTeam( gentity_t *ent, team_t newTeam ) if( oldTeam == newTeam ) return; - ent->client->pers.newTeam = newTeam; - G_LeaveTeam( ent ); - ent->client->pers.newTeam = TEAM_NONE; + G_LeaveTeamReal( ent, ( newTeam == TEAM_NONE ) ? qtrue : qfalse ); ent->client->pers.teamChangeTime = level.time; ent->client->pers.teamSelection = newTeam; diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h index cfbc586..a93b630 100644 --- a/src/qcommon/q_shared.h +++ b/src/qcommon/q_shared.h @@ -1091,7 +1091,7 @@ typedef struct { // bit field limits #define MAX_STATS 16 -#define MAX_PERSISTANT 24 +#define MAX_PERSISTANT 16 #define MAX_MISC 16 #define MAX_WEAPONS 16 |