From b8fc53ac72926facaacc40c4fba458a6bea9d5fe Mon Sep 17 00:00:00 2001 From: mikomyazaki <47489928+mikomyazaki@users.noreply.github.com> Date: Sun, 16 Feb 2020 23:22:35 +0000 Subject: [PATCH] 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. --- .../mob/living/carbon/human/human_defense.dm | 4 +- html/changelogs/armorruntimefix.yml | 41 +++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 html/changelogs/armorruntimefix.yml diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index c77d7242ca7..6f248efbd70 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -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 diff --git a/html/changelogs/armorruntimefix.yml b/html/changelogs/armorruntimefix.yml new file mode 100644 index 00000000000..7219cd26a50 --- /dev/null +++ b/html/changelogs/armorruntimefix.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: mikomyazaki + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Wearing clothing that provides armour along with clothing that does not no longer results in your character having zero armour."