From 514d15b659bb4284fdb2a17e200480048ae56fbc Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Tue, 27 Aug 2019 00:42:24 +0100 Subject: restart the current map if the next map is the same as the current map --- src/game/g_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/game/g_main.c') 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( ); -- cgit