diff --git a/src/Dodge/Block.hs b/src/Dodge/Block.hs index 60d5fd3d7..76a44776c 100644 --- a/src/Dodge/Block.hs +++ b/src/Dodge/Block.hs @@ -67,7 +67,7 @@ maybeClearPath :: World -> (Int,Int,PathEdge) -> World maybeClearPath w (x,y,pe) | runIdentity . S.any_ (const True) $ overlapSegWalls (_peStart pe) (_peEnd pe) $ wlsNearSeg (_peStart pe) (_peEnd pe) w = w - | otherwise = w & pathGraph %~ (FGL.insEdge (x,y,pe & peObstacles .~ mempty)) . FGL.delEdge (x,y) + | otherwise = w & pathGraph %~ FGL.insEdge (x,y,pe & peObstacles .~ mempty) . FGL.delEdge (x,y) destroyDoor :: Door -> World -> World destroyDoor dr w = w diff --git a/src/Dodge/Path.hs b/src/Dodge/Path.hs index d61c1d6ca..f9faf8839 100644 --- a/src/Dodge/Path.hs +++ b/src/Dodge/Path.hs @@ -36,10 +36,6 @@ makePathBetween a b w = do -- join $ sp <$> a' <*> b' <*> return (_pathGraph w) na <- walkableNodeNear w a nb <- walkableNodeNear w b sp na nb (second _peDist (_pathGraph w)) - where - --nodesNear p = concat $ lookLookups (zoneNearPointIP p) (_pathPoints w) --- nodesNear p = runIdentity . S.toList_ $ nearPoint _pnZoning p w --- walkableNodeNear p = fmap fst . find (flip (isWalkable p) w . snd) $ nodesNear p walkableNodeNear :: World -> Point2 -> Maybe Int {-# INLINE walkableNodeNear #-} @@ -132,7 +128,7 @@ obstructPathsCrossing sp ep w = edgecrosses (_,_,pe) = isJust $ intersectSegSeg sp ep (_peStart pe) (_peEnd pe) updateedges gr = runIdentity $ S.fold_ updateedge gr id edges updateedge gr (x,y,pe) - = insEdge (x,y,pe & peObstacles . at BlockObstacle .~ Just ()) $ delEdge (x,y) gr + = insEdge (x,y,pe & peObstacles . at BlockObstacle ?~ ()) $ delEdge (x,y) gr removePathsCrossing :: Point2 -> Point2 -> World -> World removePathsCrossing a b w = w diff --git a/src/Dodge/Placement/PlaceSpot/Block.hs b/src/Dodge/Placement/PlaceSpot/Block.hs index 2a39b6964..355ca030d 100644 --- a/src/Dodge/Placement/PlaceSpot/Block.hs +++ b/src/Dodge/Placement/PlaceSpot/Block.hs @@ -68,7 +68,7 @@ plLineBlock basePane blwidth a b gw = ( 0 blid = IM.newKey $ _blocks gw insertBlock (i,p) = insertWalls (i + blid) (makeWallAt p i) - . (over blocks $ IM.insert (i+blid) Block + . over blocks (IM.insert (i+blid) Block { _blID = i + blid, _blWallIDs = IS.fromList $ ksAtI i , _blHP = 1000, _blShadows = shadowsAt i , _blDir = 0 -- THIS IS NOT SENSIBLE. TODO rethink block positioning