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