Port set_stat and COMSIG_MOB_STATCHANGE from TG
This commit is contained in:
@@ -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, .)
|
||||
|
||||
Reference in New Issue
Block a user