MCPcopy Create free account
hub / github.com/JACoders/OpenJK / SV_LoadTransition_f

Function SV_LoadTransition_f

code/server/sv_ccmds.cpp:303–339  ·  view source on GitHub ↗

================== SV_LoadTransition_f ================== */

Source from the content-addressed store, hash-verified

301==================
302*/
303void SV_LoadTransition_f(void)
304{
305 const char *map;
306 const char *spawntarget;
307
308 map = Cmd_Argv(1);
309 if ( !*map ) {
310 return;
311 }
312
313 qbLoadTransition = qtrue;
314
315#ifdef JK2_MODE
316 SCR_PrecacheScreenshot();
317#endif
318 SV_Player_EndOfLevelSave();
319
320 //Save the full current state of the current map so we can return to it later
321 SG_WriteSavegame( va("hub/%s", sv_mapname->string), qfalse );
322
323 //set the spawntarget if there is one
324 spawntarget = Cmd_Argv(2);
325 if ( *spawntarget != '\0' )
326 {
327 Cvar_Set( "spawntarget", spawntarget );
328 }
329 else
330 {
331 Cvar_Set( "spawntarget", "" );
332 }
333
334 if ( !SV_TryLoadTransition( map ) )
335 {//couldn't load a savegame
336 SV_Map_( eForceReload_NOTHING );
337 }
338 qbLoadTransition = qfalse;
339}
340//===============================================================
341
342char *ivtos( const vec3_t v ) {

Callers

nothing calls this directly

Calls 7

SCR_PrecacheScreenshotFunction · 0.85
SV_Player_EndOfLevelSaveFunction · 0.85
SV_TryLoadTransitionFunction · 0.85
SV_Map_Function · 0.85
Cmd_ArgvFunction · 0.50
vaFunction · 0.50
Cvar_SetFunction · 0.50

Tested by

no test coverage detected