summaryrefslogtreecommitdiff
path: root/src/game/g_maprotation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_maprotation.c')
-rw-r--r--src/game/g_maprotation.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/game/g_maprotation.c b/src/game/g_maprotation.c
index e9f87b37..fde6f8fc 100644
--- a/src/game/g_maprotation.c
+++ b/src/game/g_maprotation.c
@@ -125,6 +125,30 @@ qboolean G_MapExists( char *name )
/*
===============
+G_PerformMapRestart
+===============
+*/
+void G_PerformMapRestart( void )
+{
+ level.restarted = qtrue;
+ trap_SendConsoleCommand( EXEC_APPEND, "map_restart\n" );
+}
+
+/*
+===============
+G_PerformMapChange
+===============
+*/
+void G_PerformMapChange( const char *map )
+{
+ char buf[ MAX_STRING_CHARS ];
+ level.restarted = qtrue;
+ Q_snprintf( buf, sizeof( buf ), "map \"%s\"\n", map );
+ trap_SendConsoleCommand( EXEC_APPEND, buf );
+}
+
+/*
+===============
G_RotationExists
Check if a rotation exists
@@ -869,7 +893,7 @@ static void G_IssueMapChange( int index, int rotation )
trap_Cvar_Set( "g_layouts", map->layouts );
}
- trap_SendConsoleCommand( EXEC_APPEND, va( "map \"%s\"\n", map->name ) );
+ G_PerformMapChange( map->name );
// Load up map defaults if g_mapConfigs is set
G_MapConfigs( map->name );