Fixed bug collecting lifeleech with ignited tnt/spray

This commit is contained in:
carnivoroussociety 2021-08-28 05:38:02 +10:00 committed by Mitchell Richters
parent 2fbfa82fe8
commit 049665e03e
3 changed files with 6 additions and 2 deletions

View file

@ -43,6 +43,7 @@ void HookReplaceFunctions();
struct PLAYER; struct PLAYER;
bool checkFired6or7(PLAYER *pPlayer);
void WeaponInit(void); void WeaponInit(void);
void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5); void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5);
void WeaponRaise(PLAYER *pPlayer); void WeaponRaise(PLAYER *pPlayer);

View file

@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h" #include "compat.h"
#include "blood.h" #include "blood.h"
#include "misc.h"
#include "d_net.h" #include "d_net.h"
BEGIN_BLD_NS BEGIN_BLD_NS
@ -206,14 +207,16 @@ void LifeLeechOperate(spritetype *pSprite, XSPRITE *pXSprite, EVENT event)
PLAYER *pPlayer = &gPlayer[nPlayer]; PLAYER *pPlayer = &gPlayer[nPlayer];
if (pPlayer->pXSprite->health > 0) if (pPlayer->pXSprite->health > 0)
{ {
evKill(pSprite->index, 3);
pPlayer->ammoCount[8] = ClipHigh(pPlayer->ammoCount[8]+pXSprite->data3, gAmmoInfo[8].max); pPlayer->ammoCount[8] = ClipHigh(pPlayer->ammoCount[8]+pXSprite->data3, gAmmoInfo[8].max);
pPlayer->hasWeapon[9] = 1; pPlayer->hasWeapon[9] = 1;
if (pPlayer->curWeapon != kWeapLifeLeech) if (pPlayer->curWeapon != kWeapLifeLeech)
{ {
if (!VanillaMode() && checkFired6or7(pPlayer)) // if tnt/spray is actively used, do not switch weapon
break;
pPlayer->weaponState = 0; pPlayer->weaponState = 0;
pPlayer->nextWeapon = 9; pPlayer->nextWeapon = 9;
} }
evKill(pSprite->index, 3);
} }
} }
break; break;

View file

@ -140,7 +140,7 @@ enum
nClientAltFireNapalm, nClientAltFireNapalm,
}; };
static bool checkFired6or7(PLAYER *pPlayer) bool checkFired6or7(PLAYER *pPlayer)
{ {
switch (pPlayer->curWeapon) switch (pPlayer->curWeapon)
{ {