- Blood: Allow fire button to be used for tnt/spray throw

Prevent alt fire blocking fire button for tnt/spray can throwing

* Advised of fix to Raze here: https://github.com/nukeykt/NBlood/pull/654#issuecomment-1253886969
* Fixes #671.
This commit is contained in:
2022-09-17 15:56:11 +10:00 committed by Mitchell Richters
parent 6aa94a9b8e
commit bcd2d82bc7

View file

@ -2166,14 +2166,15 @@ static int WeaponFindLoaded(PLAYER* pPlayer, int* a2)
int processSprayCan(PLAYER* pPlayer) int processSprayCan(PLAYER* pPlayer)
{ {
const char bUseShootAsThrow = !VanillaMode() && pPlayer->input.buttonFlags.shoot;
switch (pPlayer->weaponState) switch (pPlayer->weaponState)
{ {
case 5: case 5:
if (!(pPlayer->input.actions & SB_ALTFIRE)) if (!(pPlayer->input.actions & SB_ALTFIRE) || bUseShootAsThrow)
pPlayer->weaponState = 6; pPlayer->weaponState = 6;
return 1; return 1;
case 6: case 6:
if (pPlayer->input.actions & SB_ALTFIRE) if ((pPlayer->input.actions & SB_ALTFIRE) && !bUseShootAsThrow)
{ {
pPlayer->weaponState = 3; pPlayer->weaponState = 3;
pPlayer->fuseTime = pPlayer->weaponTimer; pPlayer->fuseTime = pPlayer->weaponTimer;
@ -2210,14 +2211,15 @@ int processSprayCan(PLAYER* pPlayer)
static bool processTNT(PLAYER* pPlayer) static bool processTNT(PLAYER* pPlayer)
{ {
const char bUseShootAsThrow = !VanillaMode() && pPlayer->input.buttonFlags.shoot;
switch (pPlayer->weaponState) switch (pPlayer->weaponState)
{ {
case 4: case 4:
if (!(pPlayer->input.actions & SB_ALTFIRE)) if (!(pPlayer->input.actions & SB_ALTFIRE) || bUseShootAsThrow)
pPlayer->weaponState = 5; pPlayer->weaponState = 5;
return 1; return 1;
case 5: case 5:
if (pPlayer->input.actions & SB_ALTFIRE) if ((pPlayer->input.actions & SB_ALTFIRE) && !bUseShootAsThrow)
{ {
pPlayer->weaponState = 1; pPlayer->weaponState = 1;
pPlayer->fuseTime = pPlayer->weaponTimer; pPlayer->fuseTime = pPlayer->weaponTimer;