From 256abb5375c5a796aa1c2414bafe55c8a8386348 Mon Sep 17 00:00:00 2001 From: Farie82 Date: Thu, 14 Jan 2021 22:41:18 +0100 Subject: [PATCH] Adds better logging for to_chat. Fixes update_inv_wear_mask runtime (#15276) Co-authored-by: joep van der velden <15887760+farie82@users.noreply.github.com> --- code/modules/mob/living/carbon/human/update_icons.dm | 2 ++ goon/code/datums/browserOutput.dm | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 91f285b2873..204112546a0 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -926,6 +926,8 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) if(wear_mask && (istype(wear_mask, /obj/item/clothing/mask) || istype(wear_mask, /obj/item/clothing/accessory))) if(!(slot_wear_mask in check_obscured_slots())) var/obj/item/organ/external/head/head_organ = get_organ("head") + if(!head_organ) + return // Nothing to update here var/datum/sprite_accessory/alt_heads/alternate_head if(head_organ.alt_head && head_organ.alt_head != "None") alternate_head = GLOB.alt_heads_list[head_organ.alt_head] diff --git a/goon/code/datums/browserOutput.dm b/goon/code/datums/browserOutput.dm index b572b18256e..c89d9f8496a 100644 --- a/goon/code/datums/browserOutput.dm +++ b/goon/code/datums/browserOutput.dm @@ -296,13 +296,11 @@ var/to_chat_src targetstring += ", [D.type]" // The final output - log_runtime(new/exception("DEBUG: to_chat called with invalid message/target.", to_chat_filename, to_chat_line), to_chat_src, list("Message: '[message]'", "Target: [targetstring]")) - return + CRASH("DEBUG: to_chat called with invalid message/target. Message: '[message]'. Target: [targetstring].") else if(is_valid_tochat_message(message)) if(istext(target)) - log_runtime(EXCEPTION("Somehow, to_chat got a text as a target")) - return + CRASH("Somehow, to_chat got a text as a target, message: '[message]', target: '[target]'") message = replacetext(message, "\n", "
")