summaryrefslogtreecommitdiff
path: root/src/server/sv_ccmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/sv_ccmds.c')
-rw-r--r--src/server/sv_ccmds.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/server/sv_ccmds.c b/src/server/sv_ccmds.c
index 8e76fa1..bfcc75c 100644
--- a/src/server/sv_ccmds.c
+++ b/src/server/sv_ccmds.c
@@ -42,9 +42,11 @@ Restart the server on a different map
static void SV_Map_f( void ) {
char *cmd;
char *map;
+ char *layout;
qboolean killBots, cheat;
char expanded[MAX_QPATH];
char mapname[MAX_QPATH];
+ char layoutname[MAX_QPATH];
int i;
map = Cmd_Argv(1);
@@ -73,6 +75,23 @@ static void SV_Map_f( void ) {
// and thus nuke the arguments of the map command
Q_strncpyz(mapname, map, sizeof(mapname));
+ // save the layout name as well
+ if ( Cmd_Argc() > 2 ) {
+ layout = Cmd_Argv(2);
+ if( Q_stricmp( layout, "" ) ) {
+ Com_sprintf (expanded, sizeof(expanded), "layouts/%s/%s.dat", map, layout);
+ if ( FS_ReadFile (expanded, NULL) == -1 ) {
+ Com_Printf ("Can't find layout %s\n", expanded);
+ return;
+ }
+ Q_strncpyz(layoutname, layout, sizeof(layoutname));
+ } else {
+ layoutname[0] = '\0';
+ }
+ } else {
+ layoutname[0] = '\0';
+ }
+
// start up the map
SV_SpawnServer( mapname, killBots );
@@ -86,6 +105,10 @@ static void SV_Map_f( void ) {
Cvar_Set( "sv_cheats", "0" );
}
+ if ( layoutname[0] ) {
+ Cvar_Set( "g_layouts", layoutname );
+ }
+
// This forces the local master server IP address cache
// to be updated on sending the next heartbeat
for( i = 0; i < MAX_MASTER_SERVERS; i++ )