Door destruction happens during door update, updates pathing

This commit is contained in:
2025-10-22 22:47:10 +01:00
parent 151c037763
commit 0fd7ba46b5
9 changed files with 145 additions and 198 deletions
+1 -17
View File
@@ -3,8 +3,6 @@
module Dodge.Update (updateUniverse) where
import Dodge.Zoning.Pathing
import Dodge.Debug.Picture
import Dodge.Zoning.Base
import Dodge.Path
import Data.Foldable
@@ -328,14 +326,8 @@ updateEdgeWallObs w (i,j) = fromMaybe w $ do
| otherwise = at DoorObstacle ?~ ()
updateDoors :: World -> World
updateDoors w = let (is,w') = foldrM doDrWdWd' w (w ^. cWorld . lWorld . doors)
updateDoors w = let (is,w') = foldrM updateDoor w (w ^. cWorld . lWorld . doors)
in updateEdgesWall (zonesExtract (w ^. incEdgeZoning & each . each %~ S.fromList) is) w'
& cWorld . lWorld . flares <>~ foldMap (drawZoneCol green peZoneSize) is
--updateDoors w = uncurry updateEdgesWall .
-- over _1 (zonesExtract (w ^. incEdgeZoning & each . each %~ S.fromList)) $ foldrM doDrWdWd' w (w ^. cWorld . lWorld . doors)
updateDoor :: Door -> World -> World
updateDoor dr = doDrWdWd (_drMech dr) dr
updateMagnets :: LWorld -> LWorld
updateMagnets lw =
@@ -561,14 +553,6 @@ updateIMl fim fup w = alaf Endo foldMap (dbArg fup) (fim w) w
updateIMl' :: (World -> IM.IntMap a) -> (a -> World -> World) -> World -> World
updateIMl' fim fup w = alaf Endo foldMap fup (fim w) w
updateAccum :: (Foldable f, Monoid m)
=> (World -> f a)
-> (a -> World -> (m, World))
-> World
-> (m, World)
updateAccum fim fup w = foldrM fup w (fim w)
--alaf Endo foldMap fup (fim w) w
updateCreatureGroups :: World -> World
updateCreatureGroups w =
w & cWorld . lWorld . creatureGroups