Merge branch 'fix-spb-lightning' into 'master'

Let Lightning Shield destroy SPB

Closes #427

See merge request KartKrew/Kart!933
This commit is contained in:
Chromatian Keiske 2023-02-23 21:59:29 +00:00
commit aa76ba45db
2 changed files with 11 additions and 5 deletions

View file

@ -632,11 +632,14 @@ static inline BlockItReturn_t PIT_LightningShieldAttack(mobj_t *thing)
return BMIT_CONTINUE;
}
if (thing->type != MT_SPB)
{
if (!(thing->flags & MF_SHOOTABLE) || (thing->flags & MF_SCENERY))
{
// Not shootable
return BMIT_CONTINUE;
}
}
if (thing->player && thing->player->spectator)
{

View file

@ -2057,9 +2057,12 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
}
if (!force)
{
if (!(target->type == MT_SPB && (damagetype & DMG_TYPEMASK) == DMG_VOLTAGE))
{
if (!(target->flags & MF_SHOOTABLE))
return false; // shouldn't happen...
}
if (!(damagetype & DMG_DEATHMASK) && (target->eflags & MFE_PAUSED))
return false;