Start to make wall flags/pathing interaction more sensible
This commit is contained in:
+3
-5
@@ -318,12 +318,10 @@ updateEdgeWallObs :: World -> (Int,Int) -> World
|
||||
updateEdgeWallObs w (i,j) = fromMaybe w $ do
|
||||
s <- getNodePos i w
|
||||
e <- getNodePos j w
|
||||
let wls = snd <$> wlsHitUnsorted s e w
|
||||
return $ w & cWorld . incGraph %~ updateEdge (f wls) (i,j)
|
||||
let wlflags = foldMap (^. _2 . wlPathFlag) $ wlsHitUnsorted s e w
|
||||
return $ w & cWorld . incGraph %~ updateEdge (f wlflags) (i,j)
|
||||
where
|
||||
f wls
|
||||
| all _wlPathable wls = (at BlockObstacle .~ Nothing) . (at DoorObstacle .~ Nothing)
|
||||
| otherwise = at DoorObstacle ?~ ()
|
||||
f x _ = S.map WallObstacle x
|
||||
|
||||
updateDoors :: World -> World
|
||||
updateDoors w = let (is,w') = foldrM updateDoor w (w ^. cWorld . lWorld . doors)
|
||||
|
||||
Reference in New Issue
Block a user