From 73bc64f9dad3b5befa9596c5fb1b7b17745c33db Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 6 Aug 2026 22:16:15 +0200 Subject: [PATCH] fix clamp assert in HWR_SplitWall idk man it really hates if lo > hi apparently lol --- src/hardware/hw_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index 562be50bb..907f80cf0 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -1101,8 +1101,8 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, // Found a break // The heights are clamped to ensure the polygon doesn't cross itself. - bot = std::clamp(bheight, realbot, top); - endbot = std::clamp(endbheight, endrealbot, endtop); + bot = std::min(std::max(bheight, realbot), top); + endbot = std::min(std::max(endbheight, endrealbot), endtop); Surf->PolyColor.s.alpha = alpha;