Fix bug in line zoning by using less ambitious algorithm
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user