From c1e0041a0bf1becf6902a8290d08c7fe18a36cf8 Mon Sep 17 00:00:00 2001
From: Monster Iestyn <iestynjealous@ntlworld.com>
Date: Fri, 14 Dec 2018 21:22:13 +0000
Subject: [PATCH] copy doom legacy's replacement for the den == 0.0 calc in
 fracdivline

---
 src/hardware/hw_bsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c
index 8fec4f967a..e0ab5b0da9 100644
--- a/src/hardware/hw_bsp.c
+++ b/src/hardware/hw_bsp.c
@@ -193,7 +193,7 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
 	v2dy = bsp->dy;
 
 	den = v2dy*v1dx - v2dx*v1dy;
-	if (den == 0.0)
+	if (fabs(den) < 1.0E-36f) // avoid checking exactly for 0.0
 		return NULL;       // parallel
 
 	// first check the frac along the polygon segment,
-- 
GitLab