Fix vanilla weapon functions passing ammo count to DepleteAmmo

This commit is contained in:
Ricardo Luís Vaz Silva 2023-11-27 20:35:42 -03:00 committed by Christoph Oelckers
parent 429d402dc4
commit 52c878c0d7
10 changed files with 15 additions and 15 deletions

View file

@ -31,7 +31,7 @@ extend class StateProvider
Weapon weap = player.ReadyWeapon;
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, 1))
if (!weap.DepleteAmmo (weap.bAltFire, true))
return;
State flash = weap.FindState('Flash');

View file

@ -107,7 +107,7 @@ extend class StateProvider
if (invoker != weap || stateinfo == null || stateinfo.mStateType != STATE_Psprite) weap = null;
if (weap != null)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, 1))
if (!weap.DepleteAmmo (weap.bAltFire, true))
return;
doesautoaim = weap.bNoAutoaim;

View file

@ -60,7 +60,7 @@ extend class StateProvider
Weapon weap = player.ReadyWeapon;
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, 1))
if (!weap.DepleteAmmo (weap.bAltFire, true))
return;
A_StartSound ("weapons/chngun", CHAN_WEAPON);

View file

@ -85,7 +85,7 @@ extend class StateProvider
Weapon weap = player.ReadyWeapon;
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, 1))
if (!weap.DepleteAmmo (weap.bAltFire, true))
return;
player.SetPsprite(PSP_FLASH, weap.FindState('Flash'), true);

View file

@ -133,7 +133,7 @@ extend class StateProvider
Weapon weap = player.ReadyWeapon;
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, 1))
if (!weap.DepleteAmmo (weap.bAltFire, true))
return;
State flash = weap.FindState('Flash');

View file

@ -152,7 +152,7 @@ extend class StateProvider
Weapon weap = player.ReadyWeapon;
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, 1))
if (!weap.DepleteAmmo (weap.bAltFire, true))
return;
}
@ -177,7 +177,7 @@ extend class StateProvider
Weapon weap = player.ReadyWeapon;
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, 1))
if (!weap.DepleteAmmo (weap.bAltFire, true))
return;
}

View file

@ -66,7 +66,7 @@ extend class StateProvider
Weapon weap = player.ReadyWeapon;
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, 1))
if (!weap.DepleteAmmo (weap.bAltFire, true))
return;
player.SetPsprite(PSP_FLASH, weap.FindState('Flash'), true);

View file

@ -74,7 +74,7 @@ extend class StateProvider
Weapon weap = player.ReadyWeapon;
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, 2))
if (!weap.DepleteAmmo (weap.bAltFire, true))
return;
player.SetPsprite(PSP_FLASH, weap.FindState('Flash'), true);

View file

@ -964,15 +964,15 @@ class Weapon : StateProvider
count1 = (Ammo1 != null) ? Ammo1.Amount : 0;
count2 = (Ammo2 != null) ? Ammo2.Amount : 0;
if (ammocount >= 0)
if (bDehAmmo && Ammo1 == null)
{
lAmmoUse1 = 0;
}
else if (ammocount >= 0)
{
lAmmoUse1 = ammocount;
lAmmoUse2 = ammocount;
}
else if (bDehAmmo && Ammo1 == null)
{
lAmmoUse1 = 0;
}
else
{
lAmmoUse1 = AmmoUse1;

View file

@ -62,7 +62,7 @@ class Mauler : StrifeWeapon
Weapon weap = player.ReadyWeapon;
if (weap != null)
{
if (!weap.DepleteAmmo (weap.bAltFire, true, 2))
if (!weap.DepleteAmmo (weap.bAltFire, true))
return;
}