Fixes add_armor runtime. (#8290)

add_armor runtimes when you're wearing any clothing without armor due to not handling armor = null, which is the default state. This fixes that.
This commit is contained in:
mikomyazaki
2020-02-16 20:22:35 -03:00
committed by GitHub
parent 4c6a717da5
commit b8fc53ac72
2 changed files with 43 additions and 2 deletions
@@ -133,10 +133,10 @@ emp_act
var/protection = 0
var/list/protective_gear = list(head, wear_mask, wear_suit, w_uniform, gloves, shoes)
for(var/obj/item/clothing/gear in protective_gear)
if(gear.body_parts_covered & def_zone.body_part)
if(!isnull(gear.armor) && gear.body_parts_covered & def_zone.body_part)
protection = add_armor(protection, gear.armor[type])
for(var/obj/item/clothing/accessory/A in gear.accessories)
if(A.body_parts_covered & def_zone.body_part)
if(!isnull(A.armor) && A.body_parts_covered & def_zone.body_part)
protection = add_armor(protection, A.armor[type])
return protection