Fix path updating when doors move
This commit is contained in:
+4
-4
@@ -319,13 +319,13 @@ updateEdgesWall = flip $ foldl' updateEdgeWallObs
|
||||
updateEdgeWallObs :: World -> (Int,Int) -> World
|
||||
updateEdgeWallObs w (i,j) = fromMaybe w $ do
|
||||
s <- getNodePos i w
|
||||
e <- getNodePos i w
|
||||
e <- getNodePos j w
|
||||
let wls = snd <$> wlsHitUnsorted s e w
|
||||
return $ w & cWorld . incGraph %~ updateEdge (f wls) (i,j)
|
||||
where
|
||||
f wls = at DoorObstacle ?~ ()
|
||||
-- | all _wlWalkable wls = (at BlockObstacle .~ Nothing) . (at DoorObstacle .~ Nothing)
|
||||
-- | otherwise = at DoorObstacle ?~ ()
|
||||
f wls
|
||||
| all _wlPathable wls = (at BlockObstacle .~ Nothing) . (at DoorObstacle .~ Nothing)
|
||||
| otherwise = at DoorObstacle ?~ ()
|
||||
|
||||
updateDoors :: World -> World
|
||||
updateDoors w = let (is,w') = foldrM doDrWdWd' w (w ^. cWorld . lWorld . doors)
|
||||
|
||||
Reference in New Issue
Block a user