diff options
author | Mikko Tiusanen <ams@daug.net> | 2014-10-18 15:57:56 +0300 |
---|---|---|
committer | Mikko Tiusanen <ams@daug.net> | 2014-10-18 15:57:56 +0300 |
commit | e7cd2f975492875faa2f26b3b13b8015d53a94d4 (patch) | |
tree | d2073406eb89be0575128fe1f5570013a346570d /src/game | |
parent | fac45098669b7516a26f7460d5ac4b9514423ee8 (diff) |
The old team is no longer stored as part of persistent data when leaving team.
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_local.h | 2 | ||||
-rw-r--r-- | src/game/g_team.c | 17 |
2 files changed, 9 insertions, 10 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; |