From 6e9cad688cf8cd5f4aca5d032aca3c6ddd29b19f Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Fri, 25 May 2018 11:51:03 -0400 Subject: [PATCH] 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. --- code/controllers/subsystem/timer.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/timer.dm b/code/controllers/subsystem/timer.dm index 45e2b667cf..3954edb974 100644 --- a/code/controllers/subsystem/timer.dm +++ b/code/controllers/subsystem/timer.dm @@ -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")