mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
fix mbf21 A_ConsumeAmmo ignoring explicit amount arg if weapon's ammopershot field set
This commit is contained in:
parent
25f28c4b50
commit
a4b124bff8
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue