From f94bf5c18f036e6f030d213a5e30f39976c4bf1d Mon Sep 17 00:00:00 2001 From: Nerezza Date: Mon, 21 Nov 2016 20:29:11 -0600 Subject: [PATCH] Fixes runtime in inventory.dm Clicking an inventory slot with nothing in your active hand would runtime. Now it checks to make sure you have something in your active hand, and if not it returns 0. --- code/modules/mob/inventory.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 1c6e2436d4..e89dd9cacd 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -48,6 +48,8 @@ var/list/slot_equipment_priority = list( \ //set disable_warning to disable the 'you are unable to equip that' warning. //unset redraw_mob to prevent the mob from being redrawn at the end. /mob/proc/equip_to_slot_if_possible(obj/item/W as obj, slot, del_on_fail = 0, disable_warning = 0, redraw_mob = 1) + if(!W) + return 0 if(!W.mob_can_equip(src, slot)) if(del_on_fail) qdel(W)