Merge branch '1239' into 'next'

Issue #1239 - Remove MF_PUSHABLE from Brak's electric shield

Closes #1239

See merge request STJr/SRB2!2465
This commit is contained in:
SSNTails 2025-03-22 05:31:19 +00:00
commit a0072c73bf
2 changed files with 18 additions and 8 deletions

View file

@ -6574,7 +6574,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
DMG_ELECTRIC, // mass
1, // damage
sfx_beelec, // activesound
MF_PAIN|MF_FIRE|MF_NOGRAVITY|MF_PUSHABLE, // flags
MF_PAIN|MF_FIRE|MF_NOGRAVITY, // flags
S_NULL // raisestate
},

View file

@ -3119,10 +3119,23 @@ void P_MobjCheckWater(mobj_t *mobj)
mobj->eflags |= MFE_TOUCHWATER;
// Actually in the water?
if (((mobj->eflags & MFE_VERTICALFLIP) && thingtop - (height>>1) > bottomheight)
|| (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->z + (height>>1) < topheight))
if (((mobj->eflags & MFE_VERTICALFLIP) && thingtop - (height >> 1) > bottomheight)
|| (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->z + (height >> 1) < topheight))
{
mobj->eflags |= MFE_UNDERWATER;
if (mobj->type == MT_CYBRAKDEMON_ELECTRIC_BARRIER)
{
// Special backwards-compatible case for Brak's electric barrier -- execute pushable linedef executors in the water sector,
// if they exist.
sector_t *controlSector = sectors + rover->secnum;
if (controlSector->special & 16) // Is there a cleaner way to check this? Don't like magic numbers...
P_LinedefExecute(controlSector->triggertag, mobj, controlSector);
P_KillMobj(mobj, NULL, NULL, 0);
}
}
if (mobj->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER))
{
if (rover->master->frontsector->damagetype == SD_FIRE || rover->master->frontsector->damagetype == SD_LAVA)
@ -7931,7 +7944,7 @@ static boolean P_MobjPushableThink(mobj_t *mobj)
P_MobjCheckWater(mobj);
P_PushableThinker(mobj);
// Extinguish fire objects in water. (Yes, it's extraordinarily rare to have a pushable flame object, but Brak uses such a case.)
// Extinguish fire objects in water. (Yes, it's extraordinarily rare to have a pushable flame object)
if ((mobj->flags & MF_FIRE) && !(mobj->eflags & MFE_TOUCHLAVA)
&& (mobj->eflags & (MFE_UNDERWATER | MFE_TOUCHWATER)))
{
@ -9861,13 +9874,10 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
// check mobj against possible water content, before movement code
P_MobjCheckWater(mobj);
// Extinguish fire objects in water
// If a fire object was extinguished in P_MobjCheckWater, return false here to stop the iteration.
if ((mobj->flags & MF_FIRE) && !(mobj->eflags & MFE_TOUCHLAVA)
&& (mobj->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)))
{
P_KillMobj(mobj, NULL, NULL, 0);
return false;
}
break;
}
return true;