Port set_stat and COMSIG_MOB_STATCHANGE from TG

This commit is contained in:
Elizabeth Lavenza
2024-04-13 18:04:11 -04:00
parent dd8c641520
commit 174aca4b01
25 changed files with 47 additions and 33 deletions
+12
View File
@@ -1009,3 +1009,15 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
*/
/mob/proc/on_item_dropped(obj/item/I)
return
/**
* Used to wrap stat setting to trigger on-stat-change functionality.
* Must be used instead of directly setting a mob's stat var,
* so that the signal is sent properly.
*/
/mob/proc/set_stat(new_stat)
if(new_stat == stat)
return
. = stat
stat = new_stat
SEND_SIGNAL(src, COMSIG_MOB_STATCHANGE, new_stat, .)