Skip to content

Commit

Permalink
- Renamed checkFired6or7->checkLitSprayOrTNT
Browse files Browse the repository at this point in the history
replicates NBlood 285ad39455556ede31a0a94796a324ac43d1e3ef
  • Loading branch information
coelckers committed May 5, 2022
1 parent 67339d1 commit 2576de0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion source/games/blood/src/misc.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source/games/blood/src/triggers.cpp
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions source/games/blood/src/weapon.cpp
Expand Up @@ -145,7 +145,7 @@ enum
//
//---------------------------------------------------------------------------

bool checkFired6or7(PLAYER* pPlayer)
bool checkLitSprayOrTNT(PLAYER* pPlayer)
{
switch (pPlayer->curWeapon)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -2380,7 +2380,7 @@ void WeaponProcess(PLAYER* pPlayer) {
}
if (pPlayer->isUnderwater && BannedUnderwater(pPlayer->curWeapon))
{
if (checkFired6or7(pPlayer))
if (checkLitSprayOrTNT(pPlayer))
{
if (pPlayer->curWeapon == kWeapSpraycan)
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2576de0

Please sign in to comment.