From bac34d783e7238282bc9fcac06fc6796623efbc8 Mon Sep 17 00:00:00 2001
From: RedEnchilada <redenchilada@derpymail.com>
Date: Sat, 25 Apr 2015 20:39:18 -0500
Subject: [PATCH] Fix crash with ceiling slopes and line collisions

---
 src/p_maputl.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/p_maputl.c b/src/p_maputl.c
index 2f65ea8de..f0a08883c 100644
--- a/src/p_maputl.c
+++ b/src/p_maputl.c
@@ -357,7 +357,7 @@ void P_CameraLineOpening(line_t *linedef)
 		if (sectors[front->camsec].c_slope)
 			frontceiling = P_GetZAt(sectors[front->camsec].c_slope, camera.x, camera.y);
 #endif
-			
+
 	}
 	else if (front->heightsec >= 0)
 	{
@@ -463,7 +463,7 @@ void P_CameraLineOpening(line_t *linedef)
 /*#ifdef ESLOPE
 					if (rover->t_slope)
 						topheight = P_GetZAt(rover->t_slope, camera.x, camera.y);
-					
+
 					if (rover->b_slope)
 						bottomheight = P_GetZAt(rover->b_slope, camera.x, camera.y);
 #endif // ESLOPE*/
@@ -494,7 +494,7 @@ void P_CameraLineOpening(line_t *linedef)
 /*#ifdef ESLOPE
 					if (rover->t_slope)
 						topheight = P_GetZAt(rover->t_slope, camera.x, camera.y);
-					
+
 					if (rover->b_slope)
 						bottomheight = P_GetZAt(rover->b_slope, camera.x, camera.y);
 #endif // ESLOPE*/
@@ -642,7 +642,7 @@ void P_LineOpening(line_t *linedef)
 			if (front->c_slope) highceiling = P_GetZAt(front->c_slope, tmthing->x, tmthing->y);
 		}
 
-		if (front->c_slope && front->floorheight < back->floorheight)
+		if (front->f_slope && front->floorheight < back->floorheight)
 		{
 			openbottom = P_GetZAt(front->f_slope, tmthing->x, tmthing->y);
 			if (back->f_slope) lowfloor = P_GetZAt(back->f_slope, tmthing->x, tmthing->y);
@@ -683,11 +683,11 @@ void P_LineOpening(line_t *linedef)
 
 				fixed_t topheight = *rover->topheight;
 				fixed_t bottomheight = *rover->bottomheight;
-				
+
 /*#ifdef ESLOPE
 				if (rover->t_slope)
 					topheight = P_GetZAt(rover->t_slope, camera.x, camera.y);
-				
+
 				if (rover->b_slope)
 					bottomheight = P_GetZAt(rover->b_slope, camera.x, camera.y);
 #endif*/
@@ -730,7 +730,7 @@ void P_LineOpening(line_t *linedef)
 /*#ifdef ESLOPE
 				if (rover->t_slope)
 					topheight = P_GetZAt(rover->t_slope, tmthing->x, tmthing->y);
-				
+
 				if (rover->b_slope)
 					bottomheight = P_GetZAt(rover->b_slope, tmthing->x, tmthing->y);
 #endif*/