about summary refs log tree commit diff
path: root/users/grfn/xanthous/src/Xanthous/App.hs
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-11-06T16·24-0400
committergrfn <grfn@gws.fyi>2021-11-06T17·34+0000
commiteeafd0fa0ed85957f0609863d1d06b570c55341b (patch)
tree2f00ad265dd31f4d1d0f4a2ea418aed8f70071c1 /users/grfn/xanthous/src/Xanthous/App.hs
parent580e37ff64b47f46cbafe39e448847320295f591 (diff)
fix(gs/xanthous): Don't gen dupe tutorial messages r/3011
Don't generate tutorial messages on levels other than the first.

Change-Id: I7681377461b92f5d5015931b0088bef9d358d2e4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3804
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/grfn/xanthous/src/Xanthous/App.hs')
-rw-r--r--users/grfn/xanthous/src/Xanthous/App.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/users/grfn/xanthous/src/Xanthous/App.hs b/users/grfn/xanthous/src/Xanthous/App.hs
index bf6a63e086ce..9318c713478b 100644
--- a/users/grfn/xanthous/src/Xanthous/App.hs
+++ b/users/grfn/xanthous/src/Xanthous/App.hs
@@ -568,12 +568,14 @@ showPanel panel = do
 genLevel
   :: Word -- ^ Level number, starting at 0
   -> AppM Level
-genLevel _num = do
+genLevel num = do
   let dims = Dimensions 80 80
   generator <- choose $ CaveAutomata :| [Dungeon]
-  level <- case generator of
-    CaveAutomata -> generateLevel SCaveAutomata CaveAutomata.defaultParams dims
-    Dungeon -> generateLevel SDungeon Dungeon.defaultParams dims
+  let
+    doGen = case generator of
+      CaveAutomata -> generateLevel SCaveAutomata CaveAutomata.defaultParams
+      Dungeon -> generateLevel SDungeon Dungeon.defaultParams
+  level <- doGen dims num
   pure $!! level
 
 levelToGameLevel :: Level -> GameLevel