mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- Exhumed: Amend b6ec41e2b1
to ensure next/prev weapon is actually available before trying to switch to it.
* Fixes https://forum.zdoom.org/viewtopic.php?f=340&t=70266.
This commit is contained in:
parent
e702a13ef4
commit
d90badef6f
1 changed files with 12 additions and 4 deletions
|
@ -402,13 +402,21 @@ void GameInterface::Ticker()
|
|||
int weap2 = localInput.getNewWeapon();
|
||||
if (weap2 == WeaponSel_Next)
|
||||
{
|
||||
auto newWeap = currWeap == 6 ? 1 : currWeap + 2;
|
||||
localInput.setNewWeapon(newWeap);
|
||||
auto newWeap = currWeap == 6 ? 0 : currWeap + 1;
|
||||
while (!(nPlayerWeapons[nLocalPlayer] & (1 << newWeap)))
|
||||
{
|
||||
newWeap++;
|
||||
}
|
||||
localInput.setNewWeapon(newWeap + 1);
|
||||
}
|
||||
else if (weap2 == WeaponSel_Prev)
|
||||
{
|
||||
auto newWeap = currWeap == 0 ? 7 : currWeap;
|
||||
localInput.setNewWeapon(newWeap);
|
||||
auto newWeap = currWeap == 0 ? 6 : currWeap - 1;
|
||||
while (!(nPlayerWeapons[nLocalPlayer] & (1 << newWeap)))
|
||||
{
|
||||
newWeap--;
|
||||
}
|
||||
localInput.setNewWeapon(newWeap + 1);
|
||||
}
|
||||
else if (weap2 == WeaponSel_Alt)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue