Adds a number of accessory related null checks

This commit is contained in:
Anewbe
2018-05-25 12:29:33 -05:00
parent 841837191c
commit d8f1069689
5 changed files with 6 additions and 6 deletions
@@ -133,7 +133,7 @@
accessories = null
/obj/item/clothing/emp_act(severity)
if(accessories.len)
if(LAZYLEN(accessories))
for(var/obj/item/clothing/accessory/A in accessories)
A.emp_act(severity)
..()
@@ -98,7 +98,7 @@
H = src
else if (istype(src, /obj/item/clothing/under))
var/obj/item/clothing/under/S = src
if (S.accessories.len)
if (LAZYLEN(S.accessories))
H = locate() in S.accessories
if (!H)
@@ -241,7 +241,7 @@
if(legcuffed)
dat += "<BR><A href='?src=\ref[src];item=[slot_legcuffed]'>Legcuffed</A>"
if(suit && suit.accessories.len)
if(suit && LAZYLEN(suit.accessories))
dat += "<BR><A href='?src=\ref[src];item=tie'>Remove accessory</A>"
dat += "<BR><A href='?src=\ref[src];item=splints'>Remove splints</A>"
dat += "<BR><A href='?src=\ref[src];item=pockets'>Empty pockets</A>"
@@ -33,7 +33,7 @@
return
if("tie")
var/obj/item/clothing/under/suit = w_uniform
if(!istype(suit) || !suit.accessories.len)
if(!istype(suit) || !LAZYLEN(suit.accessories))
return
var/obj/item/clothing/accessory/A = suit.accessories[1]
if(!istype(A))