From bcd2d82bc7cafb8b11b6cb5386673568e0597bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=AE?= <80724828+tmyqlfpir@users.noreply.github.com> Date: Sat, 17 Sep 2022 15:56:11 +1000 Subject: [PATCH] - 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. --- source/games/blood/src/weapon.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index fdadc1ef5..b536ad7f6 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -2166,14 +2166,15 @@ static int WeaponFindLoaded(PLAYER* pPlayer, int* a2) int processSprayCan(PLAYER* pPlayer) { + const char bUseShootAsThrow = !VanillaMode() && pPlayer->input.buttonFlags.shoot; switch (pPlayer->weaponState) { case 5: - if (!(pPlayer->input.actions & SB_ALTFIRE)) + if (!(pPlayer->input.actions & SB_ALTFIRE) || bUseShootAsThrow) pPlayer->weaponState = 6; return 1; case 6: - if (pPlayer->input.actions & SB_ALTFIRE) + if ((pPlayer->input.actions & SB_ALTFIRE) && !bUseShootAsThrow) { pPlayer->weaponState = 3; pPlayer->fuseTime = pPlayer->weaponTimer; @@ -2210,14 +2211,15 @@ int processSprayCan(PLAYER* pPlayer) static bool processTNT(PLAYER* pPlayer) { + const char bUseShootAsThrow = !VanillaMode() && pPlayer->input.buttonFlags.shoot; switch (pPlayer->weaponState) { case 4: - if (!(pPlayer->input.actions & SB_ALTFIRE)) + if (!(pPlayer->input.actions & SB_ALTFIRE) || bUseShootAsThrow) pPlayer->weaponState = 5; return 1; case 5: - if (pPlayer->input.actions & SB_ALTFIRE) + if ((pPlayer->input.actions & SB_ALTFIRE) && !bUseShootAsThrow) { pPlayer->weaponState = 1; pPlayer->fuseTime = pPlayer->weaponTimer;