From 7518262c6e329fe6f69fbe2cd4e7fb170c1b1661 Mon Sep 17 00:00:00 2001 From: Toastical Date: Mon, 10 Feb 2025 05:34:30 +0200 Subject: [PATCH] fixes blind rushers hallucination runtimes (#28084) * adds a qdeleted check * seems good enough --------- Co-authored-by: Toastical Co-authored-by: Toastical --- code/controllers/subsystem/SStimer.dm | 4 ++++ .../hallucinations/effects/blind_rush_hallucination.dm | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/controllers/subsystem/SStimer.dm b/code/controllers/subsystem/SStimer.dm index 9c9bbeed24a..44191cb87fb 100644 --- a/code/controllers/subsystem/SStimer.dm +++ b/code/controllers/subsystem/SStimer.dm @@ -134,6 +134,8 @@ SUBSYSTEM_DEF(timer) callBack.InvokeAsync() if(ctime_timer.flags & TIMER_LOOP) + if(QDELETED(ctime_timer)) + continue ctime_timer.spent = 0 ctime_timer.timeToRun = REALTIMEOFDAY + ctime_timer.wait BINARY_INSERT_TG(ctime_timer, clienttime_timers, /datum/timedevent, ctime_timer, timeToRun, COMPARE_KEY) @@ -180,6 +182,8 @@ SUBSYSTEM_DEF(timer) last_invoke_tick = world.time if(timer.flags & TIMER_LOOP) // Prepare looping timers to re-enter the queue + if(QDELETED(timer)) + continue timer.spent = 0 timer.timeToRun = world.time + timer.wait timer.bucketJoin() diff --git a/code/modules/hallucinations/effects/blind_rush_hallucination.dm b/code/modules/hallucinations/effects/blind_rush_hallucination.dm index 88676e30316..ab19d0a12da 100644 --- a/code/modules/hallucinations/effects/blind_rush_hallucination.dm +++ b/code/modules/hallucinations/effects/blind_rush_hallucination.dm @@ -48,16 +48,12 @@ var/rush_timer = null /obj/effect/hallucination/no_delete/blind_rusher/Initialize(mapload, mob/living/carbon/target) - rush_timer = addtimer(CALLBACK(src, PROC_REF(rush)), rush_time, TIMER_LOOP | TIMER_STOPPABLE) + rush_timer = addtimer(CALLBACK(src, PROC_REF(rush)), rush_time, TIMER_LOOP | TIMER_DELETE_ME) if(prob(50)) hallucination_icon = 'icons/mob/simple_human.dmi' hallucination_icon_state = pick("clown", "skeleton_warden", "skeleton_warden_alt") return ..() -/obj/effect/hallucination/no_delete/blind_rusher/Destroy() - deltimer(rush_timer) - return ..() - /obj/effect/hallucination/no_delete/blind_rusher/proc/rush() if(get_dist(src, target) > min_distance) var/direction = get_dir(src, target) //making sure the hallucination is facing the player correctly.