From eba382df1bbe3e0f8b3ec686dc028d0c51798e1a Mon Sep 17 00:00:00 2001
From: Monster Iestyn <iestynjealous@ntlworld.com>
Date: Mon, 2 May 2016 22:08:14 +0100
Subject: [PATCH] Fix up the ceiling sky hack (yuck) a bit so my commit doesn't
 break thok barrier planes now

Interestingly these changes somehow fix how thok barrier walls block the planes, which was an issue even before slopes I believe
---
 src/r_segs.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/r_segs.c b/src/r_segs.c
index ca24df586a..9b1533daac 100644
--- a/src/r_segs.c
+++ b/src/r_segs.c
@@ -1903,9 +1903,11 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 			&& backsector->ceilingpic == skyflatnum)
 		{
 #ifdef ESLOPE
-			worldtopslope = worldhighslope =
+			worldtopslope = max(worldtopslope, worldhighslope);
+			worldhighslope = worldtopslope;
 #endif
-			worldtop = worldhigh;
+			worldtop = max(worldtop, worldhigh);
+			worldhigh = worldtop;
 		}
 
 		ds_p->sprtopclip = ds_p->sprbottomclip = NULL;
@@ -2065,8 +2067,13 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 			markceiling = false;
 		}
 
+#ifdef ESLOPE
+		if ((worldhigh <= worldbottom && worldhighslope <= worldbottomslope) ||
+		    (worldlow >= worldtop && worldlowslope >= worldtopslope))
+#else
 		if (backsector->ceilingheight <= frontsector->floorheight ||
 		    backsector->floorheight >= frontsector->ceilingheight)
+#endif
 		{
 			// closed door
 			markceiling = markfloor = true;
-- 
GitLab