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 collisionAt newPos >>= \case
Nothing -> do Nothing -> do
characterPosition .= newPos characterPosition .= newPos
stepGame
describeEntitiesAt newPos describeEntitiesAt newPos
modify updateCharacterVision modify updateCharacterVision
stepGame
Just Combat -> attackAt newPos Just Combat -> attackAt newPos
Just Stop -> pure () Just Stop -> pure ()
continue continue