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

Method FireTimerOnce

core/TimerSys.cpp:344–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344void TimerSystem::FireTimerOnce(ITimer *pTimer, bool delayExec)
345{
346 ResultType res;
347
348 if (pTimer->m_InExec)
349 {
350 return;
351 }
352
353 pTimer->m_InExec = true;
354 res = pTimer->m_Listener->OnTimer(pTimer, pTimer->m_pData);
355
356 if (!(pTimer->m_Flags & TIMER_FLAG_REPEAT))
357 {
358 pTimer->m_Listener->OnTimerEnd(pTimer, pTimer->m_pData);
359 m_SingleTimers.remove(pTimer);
360 m_FreeTimers.push(pTimer);
361 }
362 else
363 {
364 if ((res != Pl_Stop) && !pTimer->m_KillMe)
365 {
366 if (delayExec)
367 {
368 pTimer->m_ToExec = GetSimulatedTime() + pTimer->m_Interval;
369 }
370 pTimer->m_InExec = false;
371 return;
372 }
373 pTimer->m_Listener->OnTimerEnd(pTimer, pTimer->m_pData);
374 m_LoopTimers.remove(pTimer);
375 m_FreeTimers.push(pTimer);
376 }
377}
378
379void TimerSystem::KillTimer(ITimer *pTimer)
380{

Callers 1

smn_TriggerTimerFunction · 0.80

Calls 5

GetSimulatedTimeFunction · 0.85
OnTimerMethod · 0.45
OnTimerEndMethod · 0.45
removeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected