Fix visible wall detection

This commit is contained in:
2023-01-03 22:39:42 +00:00
parent 0b7da0489a
commit 883e3513bc
+1 -1
View File
@@ -123,7 +123,7 @@ overlapSegWalls sp ep = mapMaybe $ \wl -> uncurry (intersectSegSeg sp ep) (_wlLi
visibleWalls :: Point2 -> Point2 -> World -> [(Point2, Wall)] visibleWalls :: Point2 -> Point2 -> World -> [(Point2, Wall)]
{-# INLINE visibleWalls #-} {-# INLINE visibleWalls #-}
visibleWalls sp ep = visibleWalls sp ep =
takeUntil (not . wlIsOpaque . snd) takeUntil (wlIsOpaque . snd)
. sortOn (dist sp . fst) . sortOn (dist sp . fst)
. overlapSegWalls sp ep . overlapSegWalls sp ep
. wlsNearSeg sp ep . wlsNearSeg sp ep