summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
authorIronClawTrem <louie.nutman@gmail.com>2019-08-27 00:42:24 +0100
committerIronClawTrem <louie.nutman@gmail.com>2019-08-27 00:42:24 +0100
commit514d15b659bb4284fdb2a17e200480048ae56fbc (patch)
tree78e0feb44994788375e7612793f354f82644ff63 /src/game/g_main.c
parentb4948d3fef13d551bc976bccf7c554d49bc6233c (diff)
restart the current map if the next map is the same as the current map
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 5386f9f..4ae31bb 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -1868,6 +1868,10 @@ void ExitLevel( void )
gclient_t *cl;
buildHistory_t *tmp, *mark;
+ char currentmap[ MAX_CVAR_VALUE_STRING ];
+
+ trap_Cvar_VariableStringBuffer( "mapname", currentmap, sizeof( currentmap ));
+
if( level.mapRotationVoteTime )
{
if( level.time < level.mapRotationVoteTime &&
@@ -1892,7 +1896,9 @@ void ExitLevel( void )
}
}
- if ( G_MapExists( g_nextMap.string ) )
+ if( !Q_stricmp( currentmap, g_nextMap.string ) )
+ trap_SendConsoleCommand( EXEC_APPEND, "map_restart\n" );
+ else if ( G_MapExists( g_nextMap.string ) )
trap_SendConsoleCommand( EXEC_APPEND, va("!map %s\n", g_nextMap.string ) );
else if( G_MapRotationActive( ) )
G_AdvanceMapRotation( );