From a3c7a3fe11f0c57ba8d82afc111efd4e3d015737 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Thu, 28 Sep 2017 12:07:23 -0400 Subject: [PATCH 1/2] Self replacement fix (#30834) --- code/game/objects/items/eightball.dm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/eightball.dm b/code/game/objects/items/eightball.dm index d8be420a08..15c6bcd4b1 100644 --- a/code/game/objects/items/eightball.dm +++ b/code/game/objects/items/eightball.dm @@ -38,10 +38,14 @@ /obj/item/toy/eightball/Initialize(mapload) . = ..() - if(prob(1)) - new /obj/item/toy/eightball/haunted(get_turf(src)) + if(MakeHaunted()) return INITIALIZE_HINT_QDEL +/obj/item/toy/eightball/proc/MakeHaunted() + . = prob(1) + if(.) + new /obj/item/toy/eightball/haunted(loc) + /obj/item/toy/eightball/attack_self(mob/user) if(shaking) return @@ -105,6 +109,9 @@ GLOB.poi_list -= src . = ..() +/obj/item/toy/eightball/haunted/MakeHaunted() + return FALSE + /obj/item/toy/eightball/haunted/attack_ghost(mob/user) if(!shaking) to_chat(user, "[src] is not currently being shaken.")