diff --git a/src/info.c b/src/info.c index 3998eb88d..980e0f2b0 100644 --- a/src/info.c +++ b/src/info.c @@ -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 }, diff --git a/src/p_mobj.c b/src/p_mobj.c index 259bf19d4..e43e3eb2e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -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;