A couple of runtime fixes:

Runtime fix for Poly searching for items (runtime error: Cannot read null.w_class)

Runtime fix for safe lock-picking (runtime error: Cannot read null.len)

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5030 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
johnsonmt88@gmail.com
2012-11-08 23:25:41 +00:00
parent 8a3e9ab885
commit 4746f20f35
2 changed files with 5 additions and 5 deletions

View File

@@ -307,6 +307,6 @@ proc/listclearnulls(list/list)
return r
/proc/safe_pick_list(var/list/L)
if(L.len)
if(L && L.len)
return pick(L)
return null

View File

@@ -529,7 +529,7 @@
if(iscarbon(AM))
var/mob/living/carbon/C = AM
if(C.l_hand.w_class <= 2 || C.r_hand.w_class <= 2)
if((C.l_hand && C.l_hand.w_class <= 2) || (C.r_hand && C.r_hand.w_class <= 2))
return C
return null
@@ -558,7 +558,7 @@
if(iscarbon(AM))
var/mob/living/carbon/C = AM
if(C.l_hand.w_class <= 2 || C.r_hand.w_class <= 2)
if(C.l_hand && C.l_hand.w_class <= 2 || C.r_hand && C.r_hand.w_class <= 2)
return C
return null
@@ -609,10 +609,10 @@
var/obj/item/stolen_item = null
for(var/mob/living/carbon/C in view(1,src))
if(C.l_hand.w_class <= 2)
if(C.l_hand && C.l_hand.w_class <= 2)
stolen_item = C.l_hand
if(C.r_hand.w_class <= 2)
if(C.r_hand && C.r_hand.w_class <= 2)
stolen_item = C.r_hand
if(stolen_item)