mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-14 08:30:58 +00:00
- fixed weapon cycling in Exhumed.
The sword was checked for ammo (and failed) and wraparound was not handled. Fixes #193
This commit is contained in:
parent
921a7a7166
commit
143dd3d2cf
1 changed files with 3 additions and 2 deletions
|
@ -402,16 +402,17 @@ 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)) || (nPlayerWeapons[nLocalPlayer] & (1 << newWeap) && PlayerList[nLocalPlayer].nAmmo[newWeap] == 0))
|
while (newWeap != 0 && (!(nPlayerWeapons[nLocalPlayer] & (1 << newWeap)) || (nPlayerWeapons[nLocalPlayer] & (1 << newWeap) && PlayerList[nLocalPlayer].nAmmo[newWeap] == 0)))
|
||||||
{
|
{
|
||||||
newWeap++;
|
newWeap++;
|
||||||
|
if (newWeap > 6) newWeap = 0;
|
||||||
}
|
}
|
||||||
localInput.setNewWeapon(newWeap + 1);
|
localInput.setNewWeapon(newWeap + 1);
|
||||||
}
|
}
|
||||||
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)) || (nPlayerWeapons[nLocalPlayer] & (1 << newWeap) && PlayerList[nLocalPlayer].nAmmo[newWeap] == 0))
|
while (newWeap != 0 && ((!(nPlayerWeapons[nLocalPlayer] & (1 << newWeap)) || (nPlayerWeapons[nLocalPlayer] & (1 << newWeap) && PlayerList[nLocalPlayer].nAmmo[newWeap] == 0))))
|
||||||
{
|
{
|
||||||
newWeap--;
|
newWeap--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue