From b360f04e28c93734e6a40ecc4183c892c9e8c023 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 17 Jul 2019 20:08:43 +0200 Subject: [PATCH] - use proper interface calls to give the initial BasicArmor to the player. The old code didn't check if giving the item was proper and just went ahead adding it to the inventory unconditionally. --- wadsrc/static/zscript/actors/player/player.zs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wadsrc/static/zscript/actors/player/player.zs b/wadsrc/static/zscript/actors/player/player.zs index 0b7723a3b..1fa785f6e 100644 --- a/wadsrc/static/zscript/actors/player/player.zs +++ b/wadsrc/static/zscript/actors/player/player.zs @@ -1834,9 +1834,7 @@ class PlayerPawn : Actor // BasicArmor must come right after that. It should not affect any // other protection item as well but needs to process the damage // before the HexenArmor does. - let barmor = BasicArmor(Spawn('BasicArmor')); - barmor.BecomeItem (); - AddInventory (barmor); + GiveInventoryType('BasicArmor'); // Now add the items from the DECORATE definition let di = GetDropItems(); @@ -1885,7 +1883,7 @@ class PlayerPawn : Actor // This problem is only detectable when it's too late to do something about it... ThrowAbortException("Cannot give morph item '%s' when starting a game!", di.Name); } - } + } let weap = Weapon(item); if (weap != NULL && weap.CheckAmmo(Weapon.EitherFire, false)) {