Update pathing on block destruction without relying on _blObstructs
This commit is contained in:
+12
-12
@@ -4,7 +4,7 @@
|
||||
module Dodge.Update (updateUniverse) where
|
||||
|
||||
import Dodge.Zoning.Base
|
||||
import Dodge.Path
|
||||
--import Dodge.Path
|
||||
import Data.Foldable
|
||||
import qualified Data.Set as S
|
||||
import Color
|
||||
@@ -309,17 +309,17 @@ updateAimPos u =
|
||||
u & uvWorld . cWorld . lWorld . lAimPos
|
||||
.~ mouseWorldPos (u ^. uvWorld . input) (u ^. uvWorld . wCam)
|
||||
|
||||
updateEdgesWall :: S.Set (Int,Int) -> World -> World
|
||||
updateEdgesWall = flip $ foldl' updateEdgeWallObs
|
||||
|
||||
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
|
||||
return $ w & cWorld . incGraph %~ updateEdge (f wlflags) (i,j)
|
||||
where
|
||||
f x _ = S.map WallObstacle x
|
||||
--updateEdgesWall :: S.Set (Int,Int) -> World -> World
|
||||
--updateEdgesWall = flip $ foldl' updateEdgeWallObs
|
||||
--
|
||||
--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
|
||||
-- return $ w & cWorld . incGraph %~ updateEdge (f wlflags) (i,j)
|
||||
-- where
|
||||
-- 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