Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

[MIRROR] Fix client timers having invalid <1ds waits #1431

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion code/controllers/subsystem/timer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down