Fix bug in line zoning by using less ambitious algorithm

This commit is contained in:
2022-02-13 09:24:27 +00:00
parent 0a860e6f68
commit 9af636aa83
10 changed files with 65 additions and 22 deletions
+4 -2
View File
@@ -81,11 +81,13 @@ pushOrCrush wls cr = case mapMaybe (pushOutFromWall (_crRad cr) cpos) wls of
-- note the inclusion of endpoints in circOnSeg
crOnWall :: Creature -> World -> Bool
crOnWall cr w = any (\(a,b) -> circOnSeg a b p r) wls
crOnWall cr = any (\(a,b) -> circOnSeg a b p r)
. fmap _wlLine
. IM.filter (not . _wlWalkable)
. wallsNearPoint p
where
p = _crPos cr
r = _crRad cr
wls = fmap _wlLine . IM.filter (not . _wlWalkable) $ wallsNearPoint p w
-- assumes that the wall is orientated
-- assumes wall points are different