From bd3fd77d82b1d8f6a3a16e8581ed3dade6e69792 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 14 Feb 2023 03:17:23 +0100 Subject: [PATCH] [MIRROR] Fixes kitchen spike add context screentip runtime [MDB IGNORE] (#19330) * Fixes kitchen spike add context screentip runtime (#73392) ## About The Pull Request `held_item` does not always exist, hovering over spikes with empty hands caused a runtime error ## Changelog :cl: Melbert fix: Fixed a runtime from hovering over a meat spike / kitchen spike with an empty hand /:cl: * Fixes kitchen spike add context screentip runtime --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- code/game/objects/structures/kitchen_spike.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index e6c7cd45604..855eafba7a5 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -19,6 +19,9 @@ . += "You could attach [MEATSPIKE_IRONROD_REQUIREMENT] iron rods to it to create a Meat Spike." /obj/structure/kitchenspike_frame/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + if(isnull(held_item)) + return NONE + var/message = "" if(held_item.tool_behaviour == TOOL_WELDER) message = "Deconstruct" @@ -82,6 +85,9 @@ . += "A crowbar could remove those spikes." /obj/structure/kitchenspike/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + if(isnull(held_item)) + return NONE + if(held_item.tool_behaviour == TOOL_CROWBAR) context[SCREENTIP_CONTEXT_LMB] = "Remove Spikes" return CONTEXTUAL_SCREENTIP_SET