Step the game *before* updating vision

Stepping the game after updating the vision could allow creatures like
gormlaks to move *out* of the character's pre-calculated lines of sight,
causing gormlaks right next to the character to be invisible.
This commit is contained in:
Griffin Smith 2019-10-12 13:28:10 -04:00
parent f1197be186
commit 0837df2a72

View file

@ -119,9 +119,9 @@ handleCommand (Move dir) = do
collisionAt newPos >>= \case
Nothing -> do
characterPosition .= newPos
stepGame
describeEntitiesAt newPos
modify updateCharacterVision
stepGame
Just Combat -> attackAt newPos
Just Stop -> pure ()
continue