From 883e3513bc22ae89f4da412c992ab48c05d2816b Mon Sep 17 00:00:00 2001 From: justin Date: Tue, 3 Jan 2023 22:39:42 +0000 Subject: [PATCH] Fix visible wall detection --- src/Dodge/Base/Collide.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dodge/Base/Collide.hs b/src/Dodge/Base/Collide.hs index 5826f8419..ef3bc601b 100644 --- a/src/Dodge/Base/Collide.hs +++ b/src/Dodge/Base/Collide.hs @@ -123,7 +123,7 @@ overlapSegWalls sp ep = mapMaybe $ \wl -> uncurry (intersectSegSeg sp ep) (_wlLi visibleWalls :: Point2 -> Point2 -> World -> [(Point2, Wall)] {-# INLINE visibleWalls #-} visibleWalls sp ep = - takeUntil (not . wlIsOpaque . snd) + takeUntil (wlIsOpaque . snd) . sortOn (dist sp . fst) . overlapSegWalls sp ep . wlsNearSeg sp ep