diff options
author | Mikko Tiusanen <ams@daug.net> | 2014-08-19 21:47:12 +0300 |
---|---|---|
committer | Mikko Tiusanen <ams@daug.net> | 2014-08-19 21:47:12 +0300 |
commit | a7ca0aa8c8a66adce30b8ac21d4849b91e4fc75b (patch) | |
tree | 03f08069aaae71ce18dcfd08e32892dd5573977e /src/server | |
parent | 5618f2bb4b91f4942d6936fdd18b42e354feee9c (diff) |
Added support for selecting layout with map vote.
Removed outdated comments and moved trapper accuracy to tremulous header.
Disabled map votes during first minute even when there's only one player connected.
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/sv_ccmds.c | 23 |
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++ ) |