about summary refs log tree commit diff
path: root/users/grfn/xanthous/src/Xanthous/App/Time.hs
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-06-18T15·51-0400
committergrfn <grfn@gws.fyi>2021-06-18T17·51+0000
commit2938675f3836d92eef5e813873065143ca73b02b (patch)
tree42dbd118dc7a9cf07f4a6082421e96dd9fa55011 /users/grfn/xanthous/src/Xanthous/App/Time.hs
parent91c71b380808c4e1c673e1ee96fe9b7bcf743b72 (diff)
fix(xanthous): Wipe memoized vision when the game updates r/2669
If the game steps forward, entities could be moving around, so we need
to wipe the memoized character vision.

Change-Id: If6ea6a8c4bed7aefef90a0a2ab17eff0af9b9bbe
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3215
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/grfn/xanthous/src/Xanthous/App/Time.hs')
-rw-r--r--users/grfn/xanthous/src/Xanthous/App/Time.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/users/grfn/xanthous/src/Xanthous/App/Time.hs b/users/grfn/xanthous/src/Xanthous/App/Time.hs
index b17348f3853e..cca352858d9c 100644
--- a/users/grfn/xanthous/src/Xanthous/App/Time.hs
+++ b/users/grfn/xanthous/src/Xanthous/App/Time.hs
@@ -16,6 +16,7 @@ import           Xanthous.Game.State
 import           Xanthous.Game.Prompt
 import           Xanthous.Game.Lenses
 import           Control.Monad.State (modify)
+import qualified Xanthous.Game.Memo as Memo
 --------------------------------------------------------------------------------
 
 
@@ -26,6 +27,7 @@ stepGameBy ticks = do
     pEntity' <- step ticks pEntity
     entities . ix eid .= pEntity'
 
+  clearMemo Memo.characterVisiblePositions
   modify updateCharacterVision
 
   whenM (uses character isDead)