From 00c0f227889e2eb228ed437c8c35aefd6e57c47c Mon Sep 17 00:00:00 2001
From: GDN <96800819+GDNgit@users.noreply.github.com>
Date: Wed, 6 Mar 2024 08:28:18 -0600
Subject: [PATCH] fixes deleted cultists still being considered cultists
(#24336)
---
code/game/gamemodes/cult/cult_mode.dm | 2 ++
code/modules/mob/living/simple_animal/constructs.dm | 7 +++++--
code/modules/mob/living/simple_animal/shade.dm | 4 ++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/code/game/gamemodes/cult/cult_mode.dm b/code/game/gamemodes/cult/cult_mode.dm
index 4f2d21d8b5c..98a73d95584 100644
--- a/code/game/gamemodes/cult/cult_mode.dm
+++ b/code/game/gamemodes/cult/cult_mode.dm
@@ -164,6 +164,7 @@
cult_objs.study(cult_mind.current)
to_chat(cult_mind.current, "For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Cultist)")
RegisterSignal(cult_mind.current, COMSIG_MOB_STATCHANGE, PROC_REF(cultist_stat_change))
+ RegisterSignal(cult_mind.current, COMSIG_PARENT_QDELETING, PROC_REF(remove_cultist))
return TRUE
/datum/game_mode/proc/remove_cultist(datum/mind/cult_mind, show_message = TRUE, remove_gear = FALSE, mob/target_mob)
@@ -204,6 +205,7 @@
cultist.visible_message("[cultist] looks like [cultist.p_they()] just reverted to [cultist.p_their()] old faith!",
"An unfamiliar white light flashes through your mind, cleansing the taint of [SSticker.cultdat ? SSticker.cultdat.entity_title1 : "Nar'Sie"] and the memories of your time as their servant with it.")
UnregisterSignal(cult_mind.current, COMSIG_MOB_STATCHANGE)
+ UnregisterSignal(cult_mind.current, COMSIG_PARENT_QDELETING)
/datum/game_mode/proc/add_cult_immunity(mob/living/target)
ADD_TRAIT(target, TRAIT_CULT_IMMUNITY, CULT_TRAIT)
diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm
index c1187ee2682..cd5bc149f7d 100644
--- a/code/modules/mob/living/simple_animal/constructs.dm
+++ b/code/modules/mob/living/simple_animal/constructs.dm
@@ -57,7 +57,6 @@
return ..()
/mob/living/simple_animal/hostile/construct/death(gibbed)
- SSticker.mode.remove_cultist(show_message = FALSE, target_mob = src)
if(held_body) // Null check for empty bodies
held_body.forceMove(get_turf(src))
SSticker.mode.add_cult_immunity(held_body)
@@ -71,7 +70,11 @@
held_body.cancel_camera()
new /obj/effect/temp_visual/cult/sparks(get_turf(src))
playsound(src, 'sound/effects/pylon_shatter.ogg', 40, TRUE)
- . = ..()
+ return ..()
+
+/mob/living/simple_animal/hostile/construct/Destroy()
+ SSticker.mode.remove_cultist(show_message = FALSE, target_mob = src)
+ return ..()
/mob/living/simple_animal/hostile/construct/proc/add_held_body(atom/movable/body)
held_body = body
diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm
index 789e61be214..7b49bb26964 100644
--- a/code/modules/mob/living/simple_animal/shade.dm
+++ b/code/modules/mob/living/simple_animal/shade.dm
@@ -38,9 +38,9 @@
. = ..()
icon_state = SSticker.cultdat?.shade_icon_state
-/mob/living/simple_animal/shade/death(gibbed)
- . = ..()
+/mob/living/simple_animal/shade/Destroy()
SSticker.mode.remove_cultist(show_message = FALSE, target_mob = src)
+ return ..()
/mob/living/simple_animal/shade/attackby(obj/item/O, mob/user) //Marker -Agouri
if(istype(O, /obj/item/soulstone))