From 965c200416e9d0593eeaeae86f878403d3b6988a Mon Sep 17 00:00:00 2001 From: pastel <hazepastel@proton.me> Date: Fri, 13 Dec 2024 11:52:01 -0600 Subject: [PATCH] Use old behaviour for goop and previous version ghosts --- src/p_mobj.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 8bad6f60f9..a8e6008e3a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3103,6 +3103,7 @@ void P_MobjCheckWater(mobj_t *mobj) for (rover = sector->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; + fixed_t fakemomz = mobj->momz; if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || (((rover->fofflags & FOF_BLOCKPLAYER) && mobj->player) || ((rover->fofflags & FOF_BLOCKOTHERS) && !mobj->player))) @@ -3124,18 +3125,22 @@ void P_MobjCheckWater(mobj_t *mobj) continue; } + // TODO 2.3: remove the demo compat check and fix goop to not jank out + if ((rover->fofflags & FOF_GOOWATER) || (demoversion < 0x0012)) + fakemomz = 0; + // Set the watertop and waterbottom mobj->watertop = topheight; mobj->waterbottom = bottomheight; // Just touching the water? - if (((mobj->eflags & MFE_VERTICALFLIP) && thingtop - (mobj->momz + height) < bottomheight) - || (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->z + (mobj->momz + height) > topheight)) + if (((mobj->eflags & MFE_VERTICALFLIP) && thingtop - (fakemomz + height) < bottomheight) + || (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->z + (fakemomz + height) > topheight)) mobj->eflags |= MFE_TOUCHWATER; // Actually in the water? - if (((mobj->eflags & MFE_VERTICALFLIP) && thingtop - (mobj->momz + (height>>1)) > bottomheight) - || (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->z + (mobj->momz + (height>>1)) < topheight)) + if (((mobj->eflags & MFE_VERTICALFLIP) && thingtop - (fakemomz + (height>>1)) > bottomheight) + || (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->z + (fakemomz + (height>>1)) < topheight)) mobj->eflags |= MFE_UNDERWATER; if (mobj->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER)) -- GitLab