From 8def7b367dfbecfeb6927f2e667693595640e143 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 23 Jan 2023 23:43:12 +0100 Subject: [PATCH] [MIRROR] Fixes monkey humans having their AI turned on when revived (and having a client) [MDB IGNORE] (#18906) * Fixes monkey humans having their AI turned on when revived (and having a client) (#72799) ## About The Pull Request Stops on_stat_changed turning on AI with a client makes monkey humans not wack ## Why It's Good For The Game fixes #72432 ## Changelog :cl: fix: Monkey Humans no longer have their AI turned on upon revival /:cl: * Merge skew fixed by 72908 Co-authored-by: jimmyl <70376633+mc-oofert@users.noreply.github.com> Co-authored-by: GoldenAlpharex --- code/datums/ai/_ai_controller.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/datums/ai/_ai_controller.dm b/code/datums/ai/_ai_controller.dm index 4edd11ca3d8..2d1e41761dd 100644 --- a/code/datums/ai/_ai_controller.dm +++ b/code/datums/ai/_ai_controller.dm @@ -110,6 +110,7 @@ multiple modular subtrees with behaviors set_ai_status(AI_STATUS_ON) else set_ai_status(get_setup_mob_ai_status(new_pawn)) + RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_changed)) RegisterSignal(pawn, COMSIG_MOB_LOGIN, PROC_REF(on_sentience_gained)) @@ -123,7 +124,6 @@ multiple modular subtrees with behaviors if(ai_traits & CAN_ACT_WHILE_DEAD) return final_status - RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_changed)) if(mob_pawn.stat == DEAD) final_status = AI_STATUS_OFF @@ -300,7 +300,7 @@ multiple modular subtrees with behaviors /// Turn the controller on or off based on if you're alive, we only register to this if the flag is present so don't need to check again /datum/ai_controller/proc/on_stat_changed(mob/living/source, new_stat) SIGNAL_HANDLER - var/new_ai_status = (new_stat == DEAD) ? AI_STATUS_OFF : AI_STATUS_ON + var/new_ai_status = get_setup_mob_ai_status(source) set_ai_status(new_ai_status) /datum/ai_controller/proc/on_sentience_gained()