From 5abffabb560f6b456657e25a11793a05f39bb063 Mon Sep 17 00:00:00 2001 From: Blue Shadow Date: Sat, 3 Aug 2019 11:14:03 +0300 Subject: [PATCH] - moved GetSaveAmount() from the base armor class --- .../static/zscript/actors/inventory/armor.zs | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/wadsrc/static/zscript/actors/inventory/armor.zs b/wadsrc/static/zscript/actors/inventory/armor.zs index bfb5d15ac..0887197b1 100644 --- a/wadsrc/static/zscript/actors/inventory/armor.zs +++ b/wadsrc/static/zscript/actors/inventory/armor.zs @@ -40,23 +40,6 @@ class Armor : Inventory Inventory.PickupSound "misc/armor_pkup"; +INVENTORY.ISARMOR } - - int GetSaveAmount () - { - if (self is 'BasicArmorBonus') - { - let armor = BasicArmorBonus(self); - return !armor.bIgnoreSkill ? int(armor.SaveAmount * G_SkillPropertyFloat(SKILLP_ArmorFactor)) : armor.SaveAmount; - } - - if (self is 'BasicArmorPickup') - { - let armor = BasicArmorPickup(self); - return !armor.bIgnoreSkill ? int(armor.SaveAmount * G_SkillPropertyFloat(SKILLP_ArmorFactor)) : armor.SaveAmount; - } - - return 0; - } } //=========================================================================== @@ -342,6 +325,11 @@ class BasicArmorBonus : Armor { SaveAmount *= amount; } + + int GetSaveAmount () + { + return !bIgnoreSkill ? int(SaveAmount * G_SkillPropertyFloat(SKILLP_ArmorFactor)) : SaveAmount; + } } //=========================================================================== @@ -443,6 +431,10 @@ class BasicArmorPickup : Armor SaveAmount *= amount; } + int GetSaveAmount () + { + return !bIgnoreSkill ? int(SaveAmount * G_SkillPropertyFloat(SKILLP_ArmorFactor)) : SaveAmount; + } } //===========================================================================