Sanity check.

This commit is contained in:
Ghommie
2019-11-27 06:39:09 +01:00
parent d43d996c38
commit d1d201ff26
2 changed files with 7 additions and 1 deletions

View File

@@ -956,3 +956,8 @@
if(mood)
if(mood.sanity < SANITY_UNSTABLE)
return TRUE
/mob/living/carbon/transfer_ckey(mob/new_mob, send_signal = TRUE)
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
return ..()

View File

@@ -449,7 +449,8 @@
return
/mob/proc/transfer_ckey(mob/new_mob, send_signal = TRUE)
if(!ckey)
if(!ckey || !new_mob)
CRASH("transfer_ckey() called [ckey ? "" : "on a ckey-less mob[new_mob ? "" : " and "]"][new_mob ? "" : "without a valid mob target"]!")
return FALSE
if(send_signal)
SEND_SIGNAL(src, COMSIG_MOB_KEY_CHANGE, new_mob, src)