mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-16 17:21:10 +00:00
fix the ammocount parameter in Weapon.CheckAmmo
This commit is contained in:
parent
bcfa43b7d6
commit
99850ea216
1 changed files with 8 additions and 6 deletions
|
@ -932,6 +932,7 @@ class Weapon : StateProvider
|
|||
int count1, count2;
|
||||
int enough, enoughmask;
|
||||
int lAmmoUse1;
|
||||
int lAmmoUse2 = AmmoUse2;
|
||||
|
||||
if (sv_infiniteammo || (Owner.FindInventory ('PowerInfiniteAmmo', true) != null))
|
||||
{
|
||||
|
@ -957,20 +958,21 @@ class Weapon : StateProvider
|
|||
count1 = (Ammo1 != null) ? Ammo1.Amount : 0;
|
||||
count2 = (Ammo2 != null) ? Ammo2.Amount : 0;
|
||||
|
||||
if (bDehAmmo && Ammo1 == null)
|
||||
{
|
||||
lAmmoUse1 = 0;
|
||||
}
|
||||
else if (ammocount >= 0 && bDehAmmo)
|
||||
if (ammocount >= 0)
|
||||
{
|
||||
lAmmoUse1 = ammocount;
|
||||
lAmmoUse2 = ammocount;
|
||||
}
|
||||
else if (bDehAmmo && Ammo1 == null)
|
||||
{
|
||||
lAmmoUse1 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
lAmmoUse1 = AmmoUse1;
|
||||
}
|
||||
|
||||
enough = (count1 >= lAmmoUse1) | ((count2 >= AmmoUse2) << 1);
|
||||
enough = (count1 >= lAmmoUse1) | ((count2 >= lAmmoUse2) << 1);
|
||||
if (useboth)
|
||||
{
|
||||
enoughmask = 3;
|
||||
|
|
Loading…
Reference in a new issue