/* ================= SV_IsSimulating ================= */ qboolean SV_IsSimulating( void ) { if( sv.background && SV_Active() && CL_Active()) { if( CL_IsInConsole( )) return false; return true; // force simulating for background map } if( sv.hostflags & SVF_PLAYERSONLY ) return false; if( !SV_HasActivePlayers()) return false; if( !sv.paused && CL_IsInGame( )) return true; return false; }
//----------------------------------------------------------------------------- // Purpose: Run physics code (simulating == false means we're paused, but we'll still // allow player usercmds to be processed //----------------------------------------------------------------------------- void SV_Physics( bool simulating ) { VPROF( "SV_Physics" ); if ( !SV_HasActivePlayers() ) return; // Set time // Increment clock unless paused if ( simulating ) { sv.tickcount++; g_ServerGlobalVariables.tickcount = sv.tickcount; } g_ServerGlobalVariables.curtime = sv.gettime(); g_ServerGlobalVariables.frametime = simulating ? TICK_RATE : 0; serverGameDLL->GameFrame( simulating ); // Update gpGlobals->time to SendProxy stuff can reference timestamp g_ServerGlobalVariables.tickcount = sv.tickcount; g_ServerGlobalVariables.curtime = sv.gettime(); }