summaryrefslogtreecommitdiff
path: root/src/game/g_maprotation.c
diff options
context:
space:
mode:
authorMaeJong <mewiceclair@gmail.com>2017-05-04 22:07:14 +0200
committerPaweł Redman <pawel.redman@gmail.com>2017-05-06 13:21:10 +0200
commitc6a50934a546ddd12cf4725f4f8ec30f7adeb839 (patch)
treebd28804a54d75aea99e3caa906336fc5a65f192b /src/game/g_maprotation.c
parenta05e8cbd49a17dfc4023b71da559dcb1b11d8422 (diff)
Restart the map instead of reloading if current map == next map
Applies to both rotation and nextmap votes
Diffstat (limited to 'src/game/g_maprotation.c')
-rw-r--r--src/game/g_maprotation.c11
1 files changed, 10 insertions, 1 deletions
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 );