From f3a5ef74ca04f2f73ac5e0b34b38186173953db0 Mon Sep 17 00:00:00 2001 From: meow20 <62257265+meow20@users.noreply.github.com> Date: Sat, 30 Sep 2023 14:38:14 +0200 Subject: [PATCH] Fixes runtime when clicking an empty coat hanger with empty hand. (#22577) * prevents runtime if the hanger is clicked when its empty * changes recommended on code chat * Update code/game/objects/structures/coathanger.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --------- Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --- code/game/objects/structures/coathanger.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/game/objects/structures/coathanger.dm b/code/game/objects/structures/coathanger.dm index 21fef42091d..3bbabce64b0 100644 --- a/code/game/objects/structures/coathanger.dm +++ b/code/game/objects/structures/coathanger.dm @@ -6,8 +6,10 @@ var/obj/item/clothing/suit/coat var/list/allowed = list(/obj/item/clothing/suit/storage/labcoat, /obj/item/clothing/suit/storage/det_suit) -/obj/structure/coatrack/attack_hand(mob/user as mob) - user.visible_message("[user] takes [coat] off \the [src].", "You take [coat] off the \the [src]") +/obj/structure/coatrack/attack_hand(mob/user) + if(isnull(coat)) + return + user.visible_message("[user] takes [coat] off [src].", "You take [coat] off [src]") if(!user.put_in_active_hand(coat)) coat.forceMove(get_turf(user)) coat = null