From 2576de04b8ec42171899d149a6ae1451eccec019 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 6 May 2022 01:16:10 +0200 Subject: [PATCH] - Renamed checkFired6or7->checkLitSprayOrTNT replicates NBlood 285ad39455556ede31a0a94796a324ac43d1e3ef --- source/games/blood/src/misc.h | 2 +- source/games/blood/src/triggers.cpp | 2 +- source/games/blood/src/weapon.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/games/blood/src/misc.h b/source/games/blood/src/misc.h index 2c0ff03c2..b9a2445c3 100644 --- a/source/games/blood/src/misc.h +++ b/source/games/blood/src/misc.h @@ -46,7 +46,7 @@ int qanimateoffs(int a1, int a2); struct PLAYER; -bool checkFired6or7(PLAYER* pPlayer); +bool checkLitSprayOrTNT(PLAYER* pPlayer); void WeaponInit(void); void WeaponDraw(PLAYER* pPlayer, int a2, double a3, double a4, int a5); void WeaponRaise(PLAYER* pPlayer); diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 740406f7f..3cbd5da01 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -242,7 +242,7 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event) pPlayer->hasWeapon[kWeapLifeLeech] = 1; if (pPlayer->curWeapon != kWeapLifeLeech) { - if (!VanillaMode() && checkFired6or7(pPlayer)) // if tnt/spray is actively used, do not switch weapon + if (!VanillaMode() && checkLitSprayOrTNT(pPlayer)) // if tnt/spray is actively used, do not switch weapon break; pPlayer->weaponState = 0; pPlayer->nextWeapon = kWeapLifeLeech; diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index 26f1f839b..0b5a2e760 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -145,7 +145,7 @@ enum // //--------------------------------------------------------------------------- -bool checkFired6or7(PLAYER* pPlayer) +bool checkLitSprayOrTNT(PLAYER* pPlayer) { switch (pPlayer->curWeapon) { @@ -743,7 +743,7 @@ void WeaponRaise(PLAYER* pPlayer) void WeaponLower(PLAYER* pPlayer) { assert(pPlayer != NULL); - if (checkFired6or7(pPlayer)) + if (checkLitSprayOrTNT(pPlayer)) return; pPlayer->throwPower = 0; int prevState = pPlayer->weaponState; @@ -2058,7 +2058,7 @@ static const uint8_t gWeaponUpgrade[][13] = { int WeaponUpgrade(PLAYER* pPlayer, int newWeapon) { int weapon = pPlayer->curWeapon; - if (!checkFired6or7(pPlayer) && (cl_weaponswitch & 1) && (gWeaponUpgrade[pPlayer->curWeapon][newWeapon] || (cl_weaponswitch & 2))) + if (!checkLitSprayOrTNT(pPlayer) && (cl_weaponswitch & 1) && (gWeaponUpgrade[pPlayer->curWeapon][newWeapon] || (cl_weaponswitch & 2))) weapon = newWeapon; return weapon; } @@ -2380,7 +2380,7 @@ void WeaponProcess(PLAYER* pPlayer) { } if (pPlayer->isUnderwater && BannedUnderwater(pPlayer->curWeapon)) { - if (checkFired6or7(pPlayer)) + if (checkLitSprayOrTNT(pPlayer)) { if (pPlayer->curWeapon == kWeapSpraycan) { @@ -2570,7 +2570,7 @@ void WeaponProcess(PLAYER* pPlayer) { } if (pPlayer->newWeapon) { - if (pPlayer->isUnderwater && BannedUnderwater(pPlayer->newWeapon) && !checkFired6or7(pPlayer) && !VanillaMode()) // skip banned weapons when underwater and using next/prev weapon key inputs + if (pPlayer->isUnderwater && BannedUnderwater(pPlayer->newWeapon) && !checkLitSprayOrTNT(pPlayer) && !VanillaMode()) // skip banned weapons when underwater and using next/prev weapon key inputs { if (prevNewWeaponVal == WeaponSel_Next || prevNewWeaponVal == WeaponSel_Prev) // if player switched weapons { @@ -2636,7 +2636,7 @@ void WeaponProcess(PLAYER* pPlayer) { pPlayer->newWeapon = kWeapNone; return; } - if (pPlayer->isUnderwater && BannedUnderwater(pPlayer->newWeapon) && !checkFired6or7(pPlayer)) + if (pPlayer->isUnderwater && BannedUnderwater(pPlayer->newWeapon) && !checkLitSprayOrTNT(pPlayer)) { pPlayer->newWeapon = kWeapNone; return;