From 077ee0bc125027ec16c2e480a2a15235eb34a10c Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 10 Dec 2024 22:20:44 +0100 Subject: [PATCH] those should better be clamped oops --- src/hardware/hw_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 448d35b2c..dcfce5de2 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1059,8 +1059,9 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, continue; // Found a break - bot = max(bheight, realbot); - endbot = max(endbheight, endrealbot); + // The heights are clamped to ensure the polygon doesn't cross itself. + bot = CLAMP(bheight,realbot , top); + endbot = CLAMP(endbheight, endrealbot, endtop); Surf->PolyColor.s.alpha = alpha;