about summary refs log tree commit diff
path: root/src/Xanthous/App.hs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-12-23T23·10-0500
committerGriffin Smith <root@gws.fyi>2019-12-23T23·20-0500
commit13516911366a484ee5484166520133e056010515 (patch)
treed7618f2062ad93a3800b0b4e20b45e22ad88faa6 /src/Xanthous/App.hs
parent32421916e09dc56d91707af10474644276712fc5 (diff)
Don't send the welcome message when loading
Don't re-send the welcome message when loading the game if it's already
been sent. This is done by just tracking whether or not we've sent it as
a boolean in the game state, which may be a bit of a hack but should be fine
Diffstat (limited to 'src/Xanthous/App.hs')
-rw-r--r--src/Xanthous/App.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Xanthous/App.hs b/src/Xanthous/App.hs
index 2029be6f10..2bdf6142f9 100644
--- a/src/Xanthous/App.hs
+++ b/src/Xanthous/App.hs
@@ -77,8 +77,12 @@ startEvent = do
     Nothing -> prompt_ @'StringPrompt ["character", "namePrompt"] Uncancellable
       $ \(StringResult s) -> do
         character . characterName ?= s
-        say ["welcome"] =<< use character
-    Just n -> say ["welcome"] $ object [ "characterName" A..= n ]
+        whenM (uses sentWelcome not) $ say ["welcome"] =<< use character
+        sentWelcome .= True
+    Just n ->
+      whenM (uses sentWelcome not) $ do
+        say ["welcome"] $ object [ "characterName" A..= n ]
+        sentWelcome .= True
 
 initLevel :: AppM ()
 initLevel = do