From 0200426b51b1386b64795d7e75fc5460e2bf4a10 Mon Sep 17 00:00:00 2001 From: NepDisk <16447892+NepDisk@users.noreply.github.com> Date: Fri, 20 Sep 2024 18:40:26 -0400 Subject: [PATCH] Fix players constantly JUSTHITFLOOR when walking slowly at the top of slopes https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2358 --- src/p_mobj.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 6f413621b..1d8410a63 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1854,9 +1854,10 @@ void P_XYMovement(mobj_t *mo) */ } - else if (predictedz - mo->z > abs(slopemom.z/2) - && P_CanApplySlopePhysics(mo, mo->standingslope) == true && (!(mo->eflags & MFE_VERTICALFLIP) && (mo->z <= mo->floorz))) // mo->z <= mo->floorz means 'only do this if we did a stairstep up' - // Sryder 2018-11-26: Don't launch here if it's a slope without physics, we stick to those like glue anyway + else if (predictedz-mo->z > abs(slopemom.z/2) + && P_CanApplySlopePhysics(mo, mo->standingslope) == true // Now check if we were supposed to stick to this slope + && ((!(mo->eflags & MFE_VERTICALFLIP) && (mo->z <= mo->floorz)) // mo->z <= mo->floorz means 'only do this if we did a stairstep up' + || ((mo->eflags & MFE_VERTICALFLIP) && (mo->z+mo->height >= mo->ceilingz)))) // Always do this for old demos { // Now check if we were supposed to stick to this slope //CONS_Printf("%d-%d > %d\n", (predictedz), (mo->z), (slopemom.z/2));