diff options
author | /dev/humancontroller <devhc@example.com> | 2015-06-14 15:22:09 +0200 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-03-09 13:51:16 +0100 |
commit | fd05e89083603366d816445350b632ae60bc4387 (patch) | |
tree | 2b4bb156584235b025ca653987762056d28b771d /src/game | |
parent | 189239bc44323954c70fa9cd61d955fc3345673d (diff) |
do not "exit the level" multiple times when using admin/console commands
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_admin.c | 2 | ||||
-rw-r--r-- | src/game/g_local.h | 1 | ||||
-rw-r--r-- | src/game/g_main.c | 2 | ||||
-rw-r--r-- | src/game/g_svcmds.c | 2 |
4 files changed, 7 insertions, 0 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 2f364fb5..372891e7 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -2863,6 +2863,8 @@ qboolean G_admin_restart( gentity_t *ent ) qboolean G_admin_nextmap( gentity_t *ent ) { + if( level.exited ) + return qfalse; AP( va( "print \"^3nextmap: ^7%s^7 decided to load the next map\n\"", ( ent ) ? ent->client->pers.netname : "console" ) ); level.lastWin = TEAM_NONE; diff --git a/src/game/g_local.h b/src/game/g_local.h index 36dfff88..0ff9ce1a 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -612,6 +612,7 @@ typedef struct char spawnVarChars[ MAX_SPAWN_VARS_CHARS ]; // intermission state + qboolean exited; int intermissionQueued; // intermission was qualified, but // wait INTERMISSION_DELAY_TIME before // actually going there so the last diff --git a/src/game/g_main.c b/src/game/g_main.c index 937c578f..72c144b9 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1773,6 +1773,8 @@ void LogExit( const char *string ) gclient_t *cl; gentity_t *ent; + level.exited = qtrue; + G_LogPrintf( "Exit: %s\n", string ); level.intermissionQueued = level.time; diff --git a/src/game/g_svcmds.c b/src/game/g_svcmds.c index b5eeda7b..eaeea0c7 100644 --- a/src/game/g_svcmds.c +++ b/src/game/g_svcmds.c @@ -330,6 +330,8 @@ static void Svcmd_TeamWin_f( void ) static void Svcmd_Evacuation_f( void ) { + if( level.exited ) + return; trap_SendServerCommand( -1, "print \"Evacuation ordered\n\"" ); level.lastWin = TEAM_NONE; trap_SetConfigstring( CS_WINNER, "Evacuation" ); |