From a7ca0aa8c8a66adce30b8ac21d4849b91e4fc75b Mon Sep 17 00:00:00 2001 From: Mikko Tiusanen Date: Tue, 19 Aug 2014 21:47:12 +0300 Subject: 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. --- src/server/sv_ccmds.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/server') 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++ ) -- cgit