Skip to content

Commit

Permalink
Fix vanilla weapon functions passing ammo count to DepleteAmmo
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 authored and coelckers committed Dec 10, 2023
1 parent 429d402 commit 52c878c
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/doomweapons.zs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/weaponbfg.zs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/weaponchaingun.zs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/weaponpistol.zs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/weaponplasma.zs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions wadsrc/static/zscript/actors/doom/weaponrlaunch.zs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/weaponshotgun.zs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/weaponssg.zs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions wadsrc/static/zscript/actors/inventory/weapons.zs
Original file line number Diff line number Diff line change
Expand Up @@ -964,14 +964,14 @@ class Weapon : StateProvider
count1 = (Ammo1 != null) ? Ammo1.Amount : 0;
count2 = (Ammo2 != null) ? Ammo2.Amount : 0;

if (ammocount >= 0)
if (bDehAmmo && Ammo1 == null)
{
lAmmoUse1 = ammocount;
lAmmoUse2 = ammocount;
lAmmoUse1 = 0;
}
else if (bDehAmmo && Ammo1 == null)
else if (ammocount >= 0)
{
lAmmoUse1 = 0;
lAmmoUse1 = ammocount;
lAmmoUse2 = ammocount;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/strife/weaponmauler.zs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
Expand Down

0 comments on commit 52c878c

Please sign in to comment.