Keep track of seen walls in external list

This commit is contained in:
2023-01-03 22:36:44 +00:00
parent 5b4e8d75bb
commit 0b7da0489a
10 changed files with 30 additions and 727 deletions
+8 -4
View File
@@ -659,11 +659,15 @@ updateSeenWalls w = foldl' markWallSeen w (map (_wlID . snd) $ allVisibleWalls w
-- mw wl = wl {_wlSeen = True}
markWallSeen :: World -> Int -> World
markWallSeen !w !i = w & cWorld . lWorld . walls .~ IM.adjust markSeen i (w ^. cWorld . lWorld . walls)
markWallSeen w i = w & cWorld . lWorld . seenWalls . at i .~ Just ()
--markWallSeen !w !i = w & cWorld . lWorld . walls %~ IM.adjust markSeen i
-- in the past there might have been a space leak, which the following was meant
-- to fix
--markWallSeen !w !i = w & cWorld . lWorld . walls .~ IM.adjust markSeen i (w ^. cWorld . lWorld . walls)
markSeen :: Wall -> Wall
{-# INLINE markSeen #-}
markSeen wl = wl{_wlSeen = True}
--markSeen :: Wall -> Wall
--{-# INLINE markSeen #-}
--markSeen wl = wl{_wlSeen = True}
checkEndGame :: Universe -> Universe
checkEndGame uv = case w ^? cWorld . timeFlow . deathDelay of