Fix bugs in zones near segments
This commit is contained in:
+6
-3
@@ -1,5 +1,6 @@
|
||||
--{-# LANGUAGE TupleSections #-}
|
||||
module Dodge.Path (
|
||||
nodesNear,
|
||||
pointTowardsImpulse,
|
||||
makePathBetween,
|
||||
makePathBetweenPs,
|
||||
@@ -72,9 +73,11 @@ pathEdgeObstructed pe = any (`Set.member` pe) [WallObstacle WallNotAutoOpen, Cha
|
||||
|
||||
walkableNodeNear :: World -> Point2 -> Maybe Int
|
||||
{-# INLINE walkableNodeNear #-}
|
||||
walkableNodeNear w p = fmap fst . find (flip (isWalkable p) w . snd) $ nodesNear
|
||||
where
|
||||
nodesNear = zonesExtract (w ^. incNodeZoning) . snailAround $ zoneOfPoint pnZoneSize p
|
||||
walkableNodeNear w p = fmap fst . find (flip (isWalkable p) w . snd) $ nodesNear w p
|
||||
-- where
|
||||
-- nodesNear = zonesExtract (w ^. incNodeZoning) . snailAround $ zoneOfPoint pnZoneSize p
|
||||
|
||||
nodesNear w p = zonesExtract (w ^. incNodeZoning) . snailAround $ zoneOfPoint pnZoneSize p
|
||||
|
||||
snailAround :: Int2 -> [Int2]
|
||||
snailAround x = (x +) <$> smallSnailInt2
|
||||
|
||||
Reference in New Issue
Block a user