/* ================== SV_LoadTransition_f ================== */ void SV_LoadTransition_f(void) { char *map; char *spawntarget; map = Cmd_Argv(1); if ( !*map ) { return; } qbLoadTransition = qtrue; // SCR_PrecacheScreenshot(); SV_Player_EndOfLevelSave(); //Save the full current state of the current map so we can return to it later SG_WriteSavegame( va("hub/%s", sv_mapname->string), qfalse ); //set the spawntarget if there is one spawntarget = Cmd_Argv(2); if ( *spawntarget != NULL ) { Cvar_Set( "spawntarget", spawntarget ); } else { Cvar_Set( "spawntarget", "" ); } if ( !SV_TryLoadTransition( map ) ) {//couldn't load a savegame SV_Map_( eForceReload_NOTHING ); } qbLoadTransition = qfalse; }
/* ================== SV_Map_f Restart the server on a different map, but clears a cvar so that typing "map blah" doesn't try and preserve player weapons/ammo/etc from the previous level that you haven't really exited (ie ignores KEEP_PREV on spawn points) ================== */ static void SV_Map_f( void ) { Cvar_Set( sCVARNAME_PLAYERSAVE, ""); Cvar_Set( "spawntarget", "" ); Cvar_Set("tier_storyinfo", "0"); Cvar_Set("tiers_complete", ""); // SCR_UnprecacheScreenshot(); ForceReload_e eForceReload = eForceReload_NOTHING; // default for normal load char *cmd = Cmd_Argv( 0 ); if ( !Q_stricmp( cmd, "devmapbsp") ) eForceReload = eForceReload_BSP; else if ( !Q_stricmp( cmd, "devmapmdl") ) eForceReload = eForceReload_MODELS; else if ( !Q_stricmp( cmd, "devmapall") ) eForceReload = eForceReload_ALL; qboolean cheat = (qboolean)(!Q_stricmpn( cmd, "devmap", 6 ) ); // retain old cheat state if ( !cheat && Cvar_VariableIntegerValue( "helpUsObi" ) ) cheat = qtrue; if (SV_Map_( eForceReload )) { // set the cheat value // if the level was started with "map <levelname>", then // cheats will not be allowed. If started with "devmap <levelname>" // then cheats will be allowed Cvar_Set( "helpUsObi", cheat ? "1" : "0" ); } }
/* ================== SV_Map_f Restart the server on a different map, but clears a cvar so that typing "map blah" doesn't try and preserve player weapons/ammo/etc from the previous level that you haven't really exited (ie ignores KEEP_PREV on spawn points) ================== */ static void SV_Map_f( void ) { Cvar_Set( sCVARNAME_PLAYERSAVE, ""); Cvar_Set( "spawntarget", "" ); Cvar_Set("tier_storyinfo", "0"); Cvar_Set("tiers_complete", ""); // SCR_UnprecacheScreenshot(); ForceReload_e eForceReload = eForceReload_NOTHING; // default for normal load if ( !Q_stricmp( Cmd_Argv(0), "devmapbsp") ) { eForceReload = eForceReload_BSP; } else if ( !Q_stricmp( Cmd_Argv(0), "devmapmdl") ) { eForceReload = eForceReload_MODELS; } else if ( !Q_stricmp( Cmd_Argv(0), "devmapall") ) { eForceReload = eForceReload_ALL; } if (SV_Map_( eForceReload )) { // set the cheat value // if the level was started with "map <levelname>", then // cheats will not be allowed. If started with "devmap <levelname>" // then cheats will be allowed if ( !Q_stricmpn( Cmd_Argv(0), "devmap", 6 ) ) { Cvar_Set( "helpUsObi", "1" ); } else { Cvar_Set( "helpUsObi", "0" ); } } }
// Restart the server on a different map // //extern void SCR_PrecacheScreenshot(); //scr_scrn.cpp static void SV_MapTransition_f(void) { char *spawntarget; // SCR_PrecacheScreenshot(); SV_Player_EndOfLevelSave(); spawntarget = Cmd_Argv(2); if ( *spawntarget != NULL ) { Cvar_Set( "spawntarget", spawntarget ); } else { Cvar_Set( "spawntarget", "" ); } SV_Map_( eForceReload_NOTHING ); }