Single source of truth for wall pathing

This commit is contained in:
2025-10-24 14:25:19 +01:00
parent 0eeae7e6bc
commit 488428b1ef
19 changed files with 156 additions and 121 deletions
+3 -1
View File
@@ -1,5 +1,6 @@
module Dodge.Update.WallDamage (updateWallDamages, updateEdgesWall) where
import Dodge.Wall.Pathing
import Geometry.Data
import Control.Lens
import Data.Foldable
@@ -35,7 +36,8 @@ updateEdgeWallObs :: World -> (Int, Int) -> World
updateEdgeWallObs w (i, j) = fromMaybe w $ do
s <- getNodePos i w
e <- getNodePos j w
let wlflags = foldMap (^. _2 . wlPathFlag) $ wlsHitUnsorted s e w
--let wlflags = foldMap (^. _2 . wlPathFlag) $ wlsHitUnsorted s e w
let wlflags = foldMap (getWallPathing . (^. _2)) $ wlsHitUnsorted s e w
return $ w & cWorld . incGraph %~ updateEdge (f wlflags) (i, j)
where
f x _ = S.map WallObstacle x