mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
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:
@@ -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
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user