Merge pull request #38008 from MrStonedOne/ISawSSTimerFloatingInMyDreams

Fixes some edge cases in sstimer that could cause a timer to run before it was expecting to.
This commit is contained in:
Jordan Brown
2018-05-25 11:51:03 -04:00
committed by letterjay
parent cc088d9113
commit 6e9cad688c
+2 -2
View File
@@ -452,13 +452,13 @@ SUBSYSTEM_DEF(timer)
CRASH("addtimer called without a callback")
if (wait < 0)
stack_trace("addtimer called with a negative wait. Converting to 0")
stack_trace("addtimer called with a negative wait. Converting to [world.tick_lag]")
//alot of things add short timers on themselves in their destroy, we ignore those cases
if (wait >= 1 && callback && callback.object && callback.object != GLOBAL_PROC && QDELETED(callback.object))
stack_trace("addtimer called with a callback assigned to a qdeleted object")
wait = max(wait, 0)
wait = max(CEILING(wait, world.tick_lag), world.tick_lag)
if(wait >= INFINITY)
CRASH("Attempted to create timer with INFINITY delay")