mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 17:30:51 +00:00
Fixed bug collecting lifeleech with ignited tnt/spray
This commit is contained in:
parent
2fbfa82fe8
commit
049665e03e
3 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -140,7 +140,7 @@ enum
|
||||||
nClientAltFireNapalm,
|
nClientAltFireNapalm,
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool checkFired6or7(PLAYER *pPlayer)
|
bool checkFired6or7(PLAYER *pPlayer)
|
||||||
{
|
{
|
||||||
switch (pPlayer->curWeapon)
|
switch (pPlayer->curWeapon)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue