diff --git a/src/p_mobj.c b/src/p_mobj.c index 3059d45f533c51b1b529791016e0d3be6a2f3c10..65369934f307466910664d979d24293bdffbb2d6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3100,9 +3100,6 @@ void P_MobjCheckWater(mobj_t *mobj) // Reset water state. mobj->eflags &= ~(MFE_UNDERWATER|MFE_TOUCHWATER|MFE_GOOWATER|MFE_TOUCHLAVA); - if (mobj->momz) - height += mobj->momz; - for (rover = sector->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; @@ -3132,13 +3129,13 @@ void P_MobjCheckWater(mobj_t *mobj) mobj->waterbottom = bottomheight; // Just touching the water? - if (((mobj->eflags & MFE_VERTICALFLIP) && thingtop - height < bottomheight) - || (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->z + height > topheight)) + if (((mobj->eflags & MFE_VERTICALFLIP) && thingtop - (mobj->momz + height) < bottomheight) + || (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->z + (mobj->momz + height) > topheight)) 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 - ((mobj->momz/2) + (height>>1)) > bottomheight) + || (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->z + ((mobj->momz/2) + (height>>1)) < topheight)) mobj->eflags |= MFE_UNDERWATER; if (mobj->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER))