about summary refs log tree commit diff
path: root/src/Xanthous/Generators
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-09-20T17·14-0400
committerGriffin Smith <root@gws.fyi>2019-09-20T23·38-0400
commit4db3a68efec079bdb8723f377929bfa05860bdc2 (patch)
tree2ed2ef7c8b20f285703a9fb0c1e639faf70a075d /src/Xanthous/Generators
parent7770ed05484a8a7aae4d5d680a069a0886a145dd (diff)
Add doors and an open command
Add a Door entity and an Open command, which necessitated supporting the
direction prompt. Currently nothing actually puts doors on the map,
which puts a slight damper on actually testing this out.
Diffstat (limited to 'src/Xanthous/Generators')
-rw-r--r--src/Xanthous/Generators/CaveAutomata.hs2
-rw-r--r--src/Xanthous/Generators/LevelContents.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Xanthous/Generators/CaveAutomata.hs b/src/Xanthous/Generators/CaveAutomata.hs
index f1123abbd8f4..e885f4ed1aad 100644
--- a/src/Xanthous/Generators/CaveAutomata.hs
+++ b/src/Xanthous/Generators/CaveAutomata.hs
@@ -98,10 +98,10 @@ generate' params dims = do
   let steps' = params ^. steps
   when (steps' > 0)
    $ for_ [0 .. pred steps'] . const $ stepAutomata cells dims params
-  lift $ fillOuterEdgesM cells
   -- Remove all but the largest contiguous region of unfilled space
   (_: smallerRegions) <- lift $ regions @UArray . amap not <$> freeze cells
   lift $ fillAllM (fold smallerRegions) cells
+  lift $ fillOuterEdgesM cells
   pure cells
 
 stepAutomata :: forall s g. MCells s -> Dimensions -> Params -> CellM g s ()
diff --git a/src/Xanthous/Generators/LevelContents.hs b/src/Xanthous/Generators/LevelContents.hs
index 9192674ba7a9..87b2a28974f4 100644
--- a/src/Xanthous/Generators/LevelContents.hs
+++ b/src/Xanthous/Generators/LevelContents.hs
@@ -27,7 +27,7 @@ randomItems cells = do
   let len = rangeSize $ bounds cells
   (numItems :: Int) <- floor . (* fromIntegral len)
                      <$> getRandomR @_ @Float (0.0004, 0.001)
-  items <- for [0..numItems] $ const do
+  items <- for [0..numItems] $ const $ do
     pos <- randomPosition cells
     itemType <- fmap (fromMaybe (error "no item raws!"))
                . choose . ChooseElement