fix(xanthous): Wipe memoized vision when the game updates

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
This commit is contained in:
Griffin Smith 2021-06-18 11:51:37 -04:00 committed by grfn
parent 91c71b3808
commit 2938675f38
2 changed files with 9 additions and 3 deletions

View file

@ -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)