mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-03-10 11:11:51 +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)))
|
if (!(sv_infiniteammo || (Owner.FindInventory ('PowerInfiniteAmmo', true) != null)))
|
||||||
{
|
{
|
||||||
|
@ -1006,7 +1006,7 @@ class Weapon : StateProvider
|
||||||
{
|
{
|
||||||
if (Ammo1 != null)
|
if (Ammo1 != null)
|
||||||
{
|
{
|
||||||
if (ammouse >= 0 && bDehAmmo)
|
if (ammouse >= 0 && (bDehAmmo || forceammouse))
|
||||||
{
|
{
|
||||||
Ammo1.Amount -= ammouse;
|
Ammo1.Amount -= ammouse;
|
||||||
}
|
}
|
||||||
|
|
|
@ -430,7 +430,7 @@ extend class Weapon
|
||||||
if (!weap) return;
|
if (!weap) return;
|
||||||
|
|
||||||
if (consume == 0) consume = -1;
|
if (consume == 0) consume = -1;
|
||||||
weap.DepleteAmmo(weap.bAltFire, false, consume);
|
weap.DepleteAmmo(weap.bAltFire, false, consume, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue