From e73a2849e39bee48a8875bc53fba1a654285d074 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Sun, 13 Nov 2022 08:54:03 -0600 Subject: [PATCH] Reset `lastFrameTime` when starting a new scenario (#855) Fixes #853. --- src/Swarm/TUI/Model.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Swarm/TUI/Model.hs b/src/Swarm/TUI/Model.hs index 866f5728c..80edefd75 100644 --- a/src/Swarm/TUI/Model.hs +++ b/src/Swarm/TUI/Model.hs @@ -1039,7 +1039,8 @@ scenarioToAppState siPair@(scene, _) userSeed toRun = do -- | Modify the UI state appropriately when starting a new scenario. scenarioToUIState :: ScenarioInfoPair -> UIState -> IO UIState -scenarioToUIState siPair u = +scenarioToUIState siPair u = do + curTime <- getTime Monotonic return $ u & uiPlaying .~ True @@ -1053,3 +1054,4 @@ scenarioToUIState siPair u = & uiREPL .~ initREPLState (u ^. uiREPL . replHistory) & uiREPL . replHistory %~ restartREPLHistory & scenarioRef ?~ siPair + & lastFrameTime .~ curTime