- Renamed checkFired6or7->checkLitSprayOrTNT

replicates NBlood 285ad39455556ede31a0a94796a324ac43d1e3ef
This commit is contained in:
Christoph Oelckers 2022-05-06 01:16:10 +02:00
parent 67339d18ae
commit 2576de04b8
3 changed files with 8 additions and 8 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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;