mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 05:51:56 +01:00
Timers sanity checks Port from TG. (#6125)
This adds timers sanity checks with stack tracing of where it was called. Check are: If timer had no callback(crashes timer) If timer was called with negative wait time. Converts time to 0 and gives call stack. If timer was called on deleted or about to be deleted object. Still runs, but gives call stack If timer had infinite or more wait time. Crashes timer Adds sanity check to beams for timer wait time.
This commit is contained in:
committed by
Erki
parent
03bff09f6e
commit
f38cd3c70b
@@ -149,6 +149,9 @@
|
||||
return ..()
|
||||
|
||||
/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='icons/effects/beam.dmi',time=50, maxdistance=10,beam_type=/obj/effect/ebeam,beam_sleep_time = 3)
|
||||
if(time >= INFINITY)
|
||||
crash_with("Tried to create beam with infinite time!")
|
||||
return null
|
||||
var/datum/beam/newbeam = new(src,BeamTarget,icon,icon_state,time,maxdistance,beam_type,beam_sleep_time)
|
||||
INVOKE_ASYNC(newbeam, /datum/beam/.proc/Start)
|
||||
return newbeam
|
||||
|
||||
Reference in New Issue
Block a user