- Exhumed: Skip over weapons owned but without ammo when doing WeapSel_Next/WeapSel_Prev.

* Fixes #148.
This commit is contained in:
Mitchell Richters 2020-11-06 23:25:55 +11:00
parent e3c6873410
commit 2d903ed918

View file

@ -403,7 +403,7 @@ void GameInterface::Ticker()
if (weap2 == WeaponSel_Next) if (weap2 == WeaponSel_Next)
{ {
auto newWeap = currWeap == 6 ? 0 : currWeap + 1; auto newWeap = currWeap == 6 ? 0 : currWeap + 1;
while (!(nPlayerWeapons[nLocalPlayer] & (1 << newWeap))) while (!(nPlayerWeapons[nLocalPlayer] & (1 << newWeap)) || (nPlayerWeapons[nLocalPlayer] & (1 << newWeap) && PlayerList[nLocalPlayer].nAmmo[newWeap] == 0))
{ {
newWeap++; newWeap++;
} }
@ -412,7 +412,7 @@ void GameInterface::Ticker()
else if (weap2 == WeaponSel_Prev) else if (weap2 == WeaponSel_Prev)
{ {
auto newWeap = currWeap == 0 ? 6 : currWeap - 1; auto newWeap = currWeap == 0 ? 6 : currWeap - 1;
while (!(nPlayerWeapons[nLocalPlayer] & (1 << newWeap))) while (!(nPlayerWeapons[nLocalPlayer] & (1 << newWeap)) || (nPlayerWeapons[nLocalPlayer] & (1 << newWeap) && PlayerList[nLocalPlayer].nAmmo[newWeap] == 0))
{ {
newWeap--; newWeap--;
} }