summaryrefslogtreecommitdiff
path: root/src/game/g_team.c
diff options
context:
space:
mode:
authorMikko Tiusanen <ams@daug.net>2014-10-18 15:57:56 +0300
committerMikko Tiusanen <ams@daug.net>2014-10-18 15:57:56 +0300
commite7cd2f975492875faa2f26b3b13b8015d53a94d4 (patch)
treed2073406eb89be0575128fe1f5570013a346570d /src/game/g_team.c
parentfac45098669b7516a26f7460d5ac4b9514423ee8 (diff)
The old team is no longer stored as part of persistent data when leaving team.
Diffstat (limited to 'src/game/g_team.c')
-rw-r--r--src/game/g_team.c17
1 files changed, 9 insertions, 8 deletions
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;