From b1a926288961fceda7cab4205fed66a706500726 Mon Sep 17 00:00:00 2001
From: lachablock <lachlanwright17@gmail.com>
Date: Thu, 25 Mar 2021 15:25:35 +1100
Subject: [PATCH] Fix P_PlayerCanEnterGaps issues with polyobject collision

---
 src/p_map.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/p_map.c b/src/p_map.c
index 7eec0937c..bf668ba3e 100644
--- a/src/p_map.c
+++ b/src/p_map.c
@@ -1955,12 +1955,6 @@ static boolean PIT_CheckLine(line_t *ld)
 	// set openrange, opentop, openbottom
 	P_LineOpening(ld, tmthing);
 
-	// players should not always cross into sectors that they could not at full height
-	if (tmthing->player
-		&& openrange < P_GetPlayerHeight(tmthing->player)
-		&& !P_PlayerCanEnterSpinGaps(tmthing->player))
-			return false;
-
 	// adjust floor / ceiling heights
 	if (opentop < tmceilingz)
 	{
@@ -2729,7 +2723,10 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
 			if (thing->type == MT_SKIM)
 				maxstep = 0;
 
-			if (tmceilingz - tmfloorz < thing->height)
+			if (tmceilingz - tmfloorz < thing->height
+				|| (thing->player
+					&& tmceilingz - tmfloorz < P_GetPlayerHeight(thing->player)
+					&& !P_PlayerCanEnterSpinGaps(thing->player)))
 			{
 				if (tmfloorthing)
 					tmhitthing = tmfloorthing;