From 9c407b9516eae486c8120e66820dcd3727e943d1 Mon Sep 17 00:00:00 2001 From: "elly1989@rocketmail.com" Date: Thu, 28 Jun 2012 22:06:24 +0000 Subject: [PATCH] Adds a type check for put_in_l_hand() and put_in_r_hand() to avoid server crashing runtimes caused by bad code or var editing. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3940 316c924e-a436-60f5-8080-3fe189b3f50e --- code/modules/mob/inventory.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index e256238e8b0..2a8e2f720a0 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -14,8 +14,8 @@ //Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success. /mob/proc/put_in_l_hand(var/obj/item/W) - if(!W) return 0 - if(lying) return 0 + if(lying) return 0 + if(!istype(W)) return 0 if(!l_hand) W.loc = src //TODO: move to equipped? l_hand = W @@ -29,8 +29,8 @@ //Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success. /mob/proc/put_in_r_hand(var/obj/item/W) - if(!W) return 0 - if(lying) return 0 + if(lying) return 0 + if(!istype(W)) return 0 if(!r_hand) W.loc = src r_hand = W