- Exhumed: Repair signedness issue with weapon change code.

* Never revealed itself when I was cheating to get weapons.
* Fixes #898
This commit is contained in:
Mitchell Richters 2023-03-25 22:05:06 +11:00
parent c6054595d0
commit 2bc6df7678

View file

@ -1511,12 +1511,10 @@ static void updatePlayerAction(Player* const pPlayer)
pPlayer->bIsFiring = !!(pPlayer->input.actions & SB_FIRE);
// Handle player pressing number keys to change weapon
if (auto newWeap = pPlayer->input.getNewWeapon())
const unsigned newWeap = pPlayer->input.getNewWeapon() - 1;
if (pPlayer->nPlayerWeapons & (1 << newWeap))
{
if (pPlayer->nPlayerWeapons & (1 << (newWeap--)))
{
SetNewWeapon(pPlayer->nPlayer, newWeap);
}
SetNewWeapon(pPlayer->nPlayer, newWeap);
}
}
else // player is mummified