From ebf08178acaf0f13a46748cd1d0cd5c15eef981a Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 6 Nov 2021 22:08:58 +0000 Subject: [PATCH] [MIRROR] Spirit holding component won't let you awaken another spirit until it's done [MDB IGNORE] (#9270) * Spirit holding component won't let you awaken another spirit until it's done (#62340) * Spirit holding component won't let you awaken another spirit until it's done Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> --- code/datums/components/spirit_holding.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/datums/components/spirit_holding.dm b/code/datums/components/spirit_holding.dm index edef84c3a16..18808457a36 100644 --- a/code/datums/components/spirit_holding.dm +++ b/code/datums/components/spirit_holding.dm @@ -57,12 +57,15 @@ attempting_awakening = TRUE to_chat(awakener, span_notice("You attempt to wake the spirit of [parent]...")) - var/list/candidates = poll_ghost_candidates("Do you want to play as the spirit of [awakener.real_name]'s blade?", ROLE_PAI, FALSE, 100, POLL_IGNORE_POSSESSED_BLADE) + var/mob/dead/observer/candidates = poll_ghost_candidates("Do you want to play as the spirit of [awakener.real_name]'s blade?", ROLE_PAI, FALSE, 100, POLL_IGNORE_POSSESSED_BLADE) if(!LAZYLEN(candidates)) to_chat(awakener, span_warning("[parent] is dormant. Maybe you can try again later.")) attempting_awakening = FALSE return + //Immediately unregister to prevent making a new spirit + UnregisterSignal(parent, COMSIG_ITEM_ATTACK_SELF) + var/mob/dead/observer/chosen_spirit = pick(candidates) bound_spirit = new(parent) bound_spirit.ckey = chosen_spirit.ckey @@ -76,11 +79,10 @@ parent = input bound_spirit.fully_replace_character_name(null, "The spirit of [input]") - //prevents awakening it again + new signals for a now-possessed item - attempting_awakening = FALSE - UnregisterSignal(parent, COMSIG_ITEM_ATTACK_SELF) + //Add new signals for parent and stop attempting to awaken RegisterSignal(parent, COMSIG_ATOM_RELAYMOVE, .proc/block_buckle_message) RegisterSignal(parent, COMSIG_BIBLE_SMACKED, .proc/on_bible_smacked) + attempting_awakening = FALSE ///signal fired from a mob moving inside the parent /datum/component/spirit_holding/proc/block_buckle_message(datum/source, mob/living/user, direction)