From 1b5e645f7efaece55a98bb25140c1683ec74d6d9 Mon Sep 17 00:00:00 2001 From: Dejaku51 <40302913+Dejaku51@users.noreply.github.com> Date: Sat, 3 Sep 2022 23:16:10 +0200 Subject: [PATCH 1/2] Fix client timers having invalid <1ds waits (#7598) Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: MrStonedOne --- code/controllers/subsystem/timer.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/controllers/subsystem/timer.dm b/code/controllers/subsystem/timer.dm index 2c8a1cba37c..3a985f6f076 100644 --- a/code/controllers/subsystem/timer.dm +++ b/code/controllers/subsystem/timer.dm @@ -530,7 +530,10 @@ SUBSYSTEM_DEF(timer) 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(CEILING(wait, world.tick_lag), world.tick_lag) + if (flags & TIMER_CLIENT_TIME) // REALTIMEOFDAY has a resolution of 1 decisecond + wait = max(CEILING(wait, 1), 1) // so if we use tick_lag timers may be inserted in the "past" + else + wait = max(CEILING(wait, world.tick_lag), world.tick_lag) if(wait >= INFINITY) CRASH("Attempted to create timer with INFINITY delay") From 67f8f686e3774a012cf79361a248cd8c48bee925 Mon Sep 17 00:00:00 2001 From: SinguloBot <88859067+SinguloBot@users.noreply.github.com> Date: Sat, 3 Sep 2022 23:16:50 +0200 Subject: [PATCH 2/2] Fix client timers having invalid <1ds waits