MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / GameFrame

Method GameFrame

core/TimerSys.cpp:218–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218void TimerSystem::GameFrame(bool simulating)
219{
220 if (simulating && m_bHasMapTickedYet)
221 {
222 g_fUniversalTime += gpGlobals->curtime - m_fLastTickedTime;
223 if (!m_bHasMapSimulatedYet)
224 {
225 m_bHasMapSimulatedYet = true;
226 MapTimeLeftChanged();
227 }
228 }
229 else
230 {
231 g_fUniversalTime += gpGlobals->interval_per_tick;
232 }
233
234 m_fLastTickedTime = gpGlobals->curtime;
235 m_bHasMapTickedYet = true;
236
237 if (g_fUniversalTime >= g_fTimerThink)
238 {
239 RunFrame();
240
241 g_fTimerThink = CalcNextThink(g_fTimerThink, TIMER_MIN_ACCURACY);
242 }
243
244 RunFrameHooks(simulating);
245
246 if (m_pOnGameFrame->GetFunctionCount())
247 {
248 m_pOnGameFrame->Execute(NULL);
249 }
250}
251
252void TimerSystem::RunFrame()
253{

Callers

nothing calls this directly

Calls 4

CalcNextThinkFunction · 0.85
RunFrameHooksFunction · 0.85
GetFunctionCountMethod · 0.80
ExecuteMethod · 0.45

Tested by

no test coverage detected