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

Function CalcNextThink

core/TimerSys.cpp:147–157  ·  view source on GitHub ↗

* If the ticking process has run amok (should be impossible), we * take care of this by "skipping" the in-between time, to prevent * a bazillion times from firing on accident. This has the result * that a drastic jump in time will continue acting normally. Users * may not expect this, but... I think it is the best solution. */

Source from the content-addressed store, hash-verified

145 * may not expect this, but... I think it is the best solution.
146 */
147inline double CalcNextThink(double last, float interval)
148{
149 if (g_fUniversalTime - last - interval <= TIMER_MIN_ACCURACY)
150 {
151 return last + interval;
152 }
153 else
154 {
155 return g_fUniversalTime + interval;
156 }
157}
158
159void ITimer::Initialize(ITimedEvent *pCallbacks, float fInterval, float fToExec, void *pData, int flags)
160{

Callers 2

GameFrameMethod · 0.85
RunFrameMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected