From 62ff589840cea1ab70f6c09441173a2b66d3171c Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 12 Feb 2020 09:10:24 +0100 Subject: [PATCH] Something about a couple runtimes. --- code/game/machinery/dance_machine.dm | 2 ++ code/modules/flufftext/Hallucination.dm | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index 6bedfb0a10..38b479e226 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -202,6 +202,8 @@ for(var/i in 1 to 10) spawn_atom_to_turf(/obj/effect/temp_visual/hierophant/telegraph/edge, src, 1, FALSE) sleep(5) + if(QDELETED(src)) + return #define DISCO_INFENO_RANGE (rand(85, 115)*0.01) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 150f066886..0f4c03cdbc 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -65,6 +65,9 @@ GLOBAL_LIST_INIT(hallucination_list, list( //Returns a random turf in a ring around the target mob, useful for sound hallucinations /datum/hallucination/proc/random_far_turf() + var/turf/target_T = get_turf(target) + if(!target_T) + return var/x_based = prob(50) var/first_offset = pick(-8,-7,-6,-5,5,6,7,8) var/second_offset = rand(-8,8) @@ -76,7 +79,7 @@ GLOBAL_LIST_INIT(hallucination_list, list( else y_off = first_offset x_off = second_offset - var/turf/T = locate(target.x + x_off, target.y + y_off, target.z) + var/turf/T = locate(target_T.x + x_off, target_T.y + y_off, target_T.z) return T /obj/effect/hallucination