From 833003e6fea52f4d3cb2870d782ac6b6b02067ad Mon Sep 17 00:00:00 2001 From: SSNTails Date: Wed, 29 May 2024 18:27:09 -0400 Subject: [PATCH 1/4] I don't think Brak's electric shield needs MF_PUSHABLE.. appears to work fine without it. --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 8dd1aac80..6ec6c77b5 100644 --- a/src/info.c +++ b/src/info.c @@ -6531,7 +6531,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 }, From fc35bd3852526bcdb18950b5ec21bfefeb13ab9b Mon Sep 17 00:00:00 2001 From: SSNTails Date: Wed, 29 May 2024 19:31:00 -0400 Subject: [PATCH 2/4] Brak electric barrier triggers linedef exeutor on submersing --- src/p_mobj.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 9cdd2628d..086a1cc22 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3133,10 +3133,24 @@ 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) + { + 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) @@ -7940,7 +7954,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))) { @@ -9866,13 +9880,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; From b14a58f4b11a32384dd0f79b5c983fcaeb16bcf5 Mon Sep 17 00:00:00 2001 From: SSNTails Date: Wed, 29 May 2024 19:39:55 -0400 Subject: [PATCH 3/4] style cleanup --- src/p_mobj.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 086a1cc22..c02ed91dc 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3143,10 +3143,8 @@ void P_MobjCheckWater(mobj_t *mobj) // 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) - { + 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); } From a9a6270f0933048a71c80d1e9915bd42f006ef81 Mon Sep 17 00:00:00 2001 From: SSNTails Date: Wed, 29 May 2024 19:43:08 -0400 Subject: [PATCH 4/4] Oh gosh, this was humorous... --- src/p_mobj.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index c02ed91dc..b161f6cbf 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3145,8 +3145,9 @@ void P_MobjCheckWater(mobj_t *mobj) 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); } - P_KillMobj(mobj, NULL, NULL, 0); } if (mobj->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER))