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()