Start to make wall flags/pathing interaction more sensible

This commit is contained in:
2025-10-23 11:35:24 +01:00
parent 9e6534b8f4
commit fc7c4d6468
18 changed files with 167 additions and 145 deletions
+3 -5
View File
@@ -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)