From d40a8efce2831d9a83d4c8691ff8089600ec6c93 Mon Sep 17 00:00:00 2001
From: Louis-Antoine <lamr@free.fr>
Date: Mon, 18 May 2020 20:35:30 +0200
Subject: [PATCH] I forgot to test OpenGL :slight_smile:

---
 src/hardware/hw_main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c
index e266ee06c3..bcb0afa6e3 100644
--- a/src/hardware/hw_main.c
+++ b/src/hardware/hw_main.c
@@ -652,10 +652,14 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
 		}\
 \
 		vert->x = (vx);\
+		vert->y = height;\
 		vert->z = (vy);\
 \
-		fixedheight = P_GetZAt(slope, FLOAT_TO_FIXED((vx)), FLOAT_TO_FIXED((vy)), height);\
-		vert->y = FIXED_TO_FLOAT(fixedheight);\
+		if (slope)\
+		{\
+			fixedheight = P_GetSlopeZAt(slope, FLOAT_TO_FIXED((vx)), FLOAT_TO_FIXED((vy)));\
+			vert->y = FIXED_TO_FLOAT(fixedheight);\
+		}\
 }
 
 	for (i = 0, v3d = planeVerts; i < nrPlaneVerts; i++,v3d++,pv++)
-- 
GitLab