From c907c20480719e908e3aa3d3fff65fb9eb4e9f43 Mon Sep 17 00:00:00 2001
From: spherallic <spherallic@gmail.com>
Date: Wed, 5 Apr 2023 23:59:37 +0200
Subject: [PATCH] Do not apply pmomz when jumping through a platform

---
 src/p_map.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/p_map.c b/src/p_map.c
index a7d1f4abdd..33d599a6ce 100644
--- a/src/p_map.c
+++ b/src/p_map.c
@@ -3065,11 +3065,14 @@ static boolean P_ThingHeightClip(mobj_t *thing)
 		if (!rover || ((rover->fofflags & FOF_EXISTS) && (rover->fofflags & FOF_SOLID)))
 		{
 			hitfloor = bouncing;
-			if (thing->eflags & MFE_VERTICALFLIP)
-				thing->pmomz = thing->ceilingz - (thing->z + thing->height);
-			else
-				thing->pmomz = thing->floorz - thing->z;
-			thing->eflags |= MFE_APPLYPMOMZ;
+			if (!(thing->player) || !(thing->player->pflags & PF_JUMPED || bouncing))
+			{
+				if (thing->eflags & MFE_VERTICALFLIP)
+					thing->pmomz = thing->ceilingz - (thing->z + thing->height);
+				else
+					thing->pmomz = thing->floorz - thing->z;
+				thing->eflags |= MFE_APPLYPMOMZ;
+			}
 
 			if (thing->eflags & MFE_VERTICALFLIP)
 				thing->z = thing->ceilingz - thing->height;
-- 
GitLab