summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/g_main.c7
-rw-r--r--src/game/g_maprotation.c11
2 files changed, 16 insertions, 2 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index e539355..f7f663c 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -2089,6 +2089,9 @@ void ExitLevel( void )
int i;
gclient_t *cl;
buildHistory_t *tmp, *mark;
+ char currentmap[ MAX_CVAR_VALUE_STRING ];
+
+ trap_Cvar_VariableStringBuffer( "mapname", currentmap, sizeof( currentmap ));
if( level.mapRotationVoteTime )
{
@@ -2114,7 +2117,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( );
diff --git a/src/game/g_maprotation.c b/src/game/g_maprotation.c
index 2438ebc..b3198a4 100644
--- a/src/game/g_maprotation.c
+++ b/src/game/g_maprotation.c
@@ -615,8 +615,10 @@ static void G_IssueMapChange( int rotation )
int map = G_GetCurrentMap( rotation );
char cmd[ MAX_TOKEN_CHARS ];
char newmap[ MAX_CVAR_VALUE_STRING ];
+ char currentmap[ MAX_CVAR_VALUE_STRING ];
Q_strncpyz( newmap, mapRotations.rotations[rotation].maps[map].name, sizeof( newmap ));
+ trap_Cvar_VariableStringBuffer( "mapname", currentmap, sizeof( currentmap ));
if (!Q_stricmp( newmap, "*VOTE*") )
{
@@ -642,7 +644,14 @@ static void G_IssueMapChange( int rotation )
mapRotations.rotations[ rotation ].maps[ map ].layouts );
}
- trap_SendConsoleCommand( EXEC_APPEND, va( "map %s\n", newmap ) );
+ if( !Q_stricmp( currentmap, newmap ) )
+ {
+ trap_SendConsoleCommand( EXEC_APPEND, "map_restart\n" );
+ }
+ else
+ {
+ trap_SendConsoleCommand( EXEC_APPEND, va( "map %s\n", newmap ) );
+ }
// load up map defaults if g_mapConfigs is set
G_MapConfigs( newmap );