From fd05e89083603366d816445350b632ae60bc4387 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sun, 14 Jun 2015 15:22:09 +0200 Subject: do not "exit the level" multiple times when using admin/console commands --- src/game/g_admin.c | 2 ++ src/game/g_local.h | 1 + src/game/g_main.c | 2 ++ src/game/g_svcmds.c | 2 ++ 4 files changed, 7 insertions(+) (limited to 'src') 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" ); -- cgit