From d1d201ff26102dfa0aa28f4b330bf3bc201ee845 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 27 Nov 2019 06:39:09 +0100 Subject: [PATCH] Sanity check. --- code/modules/mob/living/carbon/carbon.dm | 5 +++++ code/modules/mob/mob.dm | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 7e52f010cc..3a9495a5cb 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -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 ..() \ No newline at end of file diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index e3daa8e3c1..ca0141bec4 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -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)