From b1e15a0da21e75b9a212d1ff150fa8050c59fed6 Mon Sep 17 00:00:00 2001 From: jammer312 Date: Sun, 3 Dec 2017 21:44:58 +0300 Subject: [PATCH] Crash to timers and INFINITY check to beams. (#33219) * beams * timers * >= instead of != * whooops --- code/controllers/subsystem/timer.dm | 3 +++ code/datums/beam.dm | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/controllers/subsystem/timer.dm b/code/controllers/subsystem/timer.dm index eca88d5126..3a2ca82bcd 100644 --- a/code/controllers/subsystem/timer.dm +++ b/code/controllers/subsystem/timer.dm @@ -357,6 +357,9 @@ SUBSYSTEM_DEF(timer) wait = max(wait, 0) + if(wait >= INFINITY) + CRASH("Attempted to create timer with INFINITY delay") + var/hash if (flags & TIMER_UNIQUE) diff --git a/code/datums/beam.dm b/code/datums/beam.dm index 252a305af2..c1a75c8b7e 100644 --- a/code/datums/beam.dm +++ b/code/datums/beam.dm @@ -29,7 +29,8 @@ icon = beam_icon icon_state = beam_icon_state beam_type = btype - addtimer(CALLBACK(src,.proc/End), time) + if(time < INFINITY) + addtimer(CALLBACK(src,.proc/End), time) /datum/beam/proc/Start() Draw()