Merge pull request #6898 from Citadel-Station-13/upstream-merge-38008

[MIRROR] Fixes some edge cases in sstimer that could cause a timer to run before it was expecting to.
This commit is contained in:
LetterJay
2018-05-26 18:38:07 -05:00
committed by GitHub
+2 -2
View File
@@ -452,12 +452,12 @@ 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]")
if (callback.object != GLOBAL_PROC && QDELETED(callback.object) && !QDESTROYING(callback.object))
stack_trace("addtimer called with a callback assigned to a qdeleted object. In the future such timers will not be supported and may refuse to run or run with a 0 wait")
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")