[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

🆑 Melbert
fix: Fixed a runtime from hovering over a meat spike / kitchen spike
with an empty hand
/🆑

* Fixes kitchen spike add context screentip runtime

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-02-14 03:17:23 +01:00
committed by GitHub
parent 2b6396719c
commit bd3fd77d82
@@ -19,6 +19,9 @@
. += "You could attach <b>[MEATSPIKE_IRONROD_REQUIREMENT]</b> iron rods to it to create a <b>Meat Spike</b>."
/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 <b>crowbar</b> 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