From a4b124bff8e25f8badea6607591804089ba3dd2e Mon Sep 17 00:00:00 2001 From: Xaser Acheron Date: Wed, 12 Jan 2022 23:08:15 -0600 Subject: [PATCH] fix mbf21 A_ConsumeAmmo ignoring explicit amount arg if weapon's ammopershot field set --- wadsrc/static/zscript/actors/inventory/weapons.zs | 4 ++-- wadsrc/static/zscript/actors/mbf21.zs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wadsrc/static/zscript/actors/inventory/weapons.zs b/wadsrc/static/zscript/actors/inventory/weapons.zs index 9c3519b487..8e1801600a 100644 --- a/wadsrc/static/zscript/actors/inventory/weapons.zs +++ b/wadsrc/static/zscript/actors/inventory/weapons.zs @@ -994,7 +994,7 @@ class Weapon : StateProvider // //=========================================================================== - virtual bool DepleteAmmo(bool altFire, bool checkEnough = true, int ammouse = -1) + virtual bool DepleteAmmo(bool altFire, bool checkEnough = true, int ammouse = -1, bool forceammouse = false) { if (!(sv_infiniteammo || (Owner.FindInventory ('PowerInfiniteAmmo', true) != null))) { @@ -1006,7 +1006,7 @@ class Weapon : StateProvider { if (Ammo1 != null) { - if (ammouse >= 0 && bDehAmmo) + if (ammouse >= 0 && (bDehAmmo || forceammouse)) { Ammo1.Amount -= ammouse; } diff --git a/wadsrc/static/zscript/actors/mbf21.zs b/wadsrc/static/zscript/actors/mbf21.zs index 1a8f76fbb5..2a703feac8 100644 --- a/wadsrc/static/zscript/actors/mbf21.zs +++ b/wadsrc/static/zscript/actors/mbf21.zs @@ -430,7 +430,7 @@ extend class Weapon if (!weap) return; if (consume == 0) consume = -1; - weap.DepleteAmmo(weap.bAltFire, false, consume); + weap.DepleteAmmo(weap.bAltFire, false, consume, true); } //