This commit is contained in:
2022-07-02 16:57:42 +01:00
parent e0222dd72b
commit dc3b78f8c4
3 changed files with 3 additions and 7 deletions
+1 -5
View File
@@ -36,10 +36,6 @@ makePathBetween a b w = do -- join $ sp <$> a' <*> b' <*> return (_pathGraph w)
na <- walkableNodeNear w a
nb <- walkableNodeNear w b
sp na nb (second _peDist (_pathGraph w))
where
--nodesNear p = concat $ lookLookups (zoneNearPointIP p) (_pathPoints w)
-- nodesNear p = runIdentity . S.toList_ $ nearPoint _pnZoning p w
-- walkableNodeNear p = fmap fst . find (flip (isWalkable p) w . snd) $ nodesNear p
walkableNodeNear :: World -> Point2 -> Maybe Int
{-# INLINE walkableNodeNear #-}
@@ -132,7 +128,7 @@ obstructPathsCrossing sp ep w =
edgecrosses (_,_,pe) = isJust $ intersectSegSeg sp ep (_peStart pe) (_peEnd pe)
updateedges gr = runIdentity $ S.fold_ updateedge gr id edges
updateedge gr (x,y,pe)
= insEdge (x,y,pe & peObstacles . at BlockObstacle .~ Just ()) $ delEdge (x,y) gr
= insEdge (x,y,pe & peObstacles . at BlockObstacle ?~ ()) $ delEdge (x,y) gr
removePathsCrossing :: Point2 -> Point2 -> World -> World
removePathsCrossing a b w = w