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
This commit is contained in:
elly1989@rocketmail.com
2012-06-28 22:06:24 +00:00
parent 0f34375088
commit 9c407b9516
+4 -4
View File
@@ -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