Define a foldr "safe" minimum
This commit is contained in:
@@ -74,7 +74,7 @@ furthestPointWalkable p1 p2 ws
|
||||
collidePointIndirect :: Point2 -> Point2 -> IM.IntMap Wall -> Maybe Point2
|
||||
{-# INLINE collidePointIndirect #-}
|
||||
collidePointIndirect p1 p2 ws
|
||||
= safeMinimumOn (dist p1)
|
||||
= safeMinimumOnr (dist p1)
|
||||
. IM.mapMaybe ( uncurry (intersectSegSeg p1 p2) . _wlLine)
|
||||
$ IM.filter (not . _wlIsSeeThrough) ws
|
||||
{- | Checks to see whether someone can fire bullets effectively between two points.
|
||||
|
||||
Reference in New Issue
Block a user