diff options
author | Griffin Smith <root@gws.fyi> | 2019-09-14T19·16-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-09-14T19·16-0400 |
commit | 6678ac986c0ccdc2a809da4fc99de7bcc0eb21f4 (patch) | |
tree | 2e4e15477b2134736eadc9674d0578320515894c /src/Xanthous/Generators/CaveAutomata.hs | |
parent | 33c831d23d09d1e80a1dcfacb373dcedec55f694 (diff) |
Fill the outer edges of generated levels
To avoid the character being able to go OOB. This is something we had in the Rust version but I hadn't ported over yet
Diffstat (limited to 'src/Xanthous/Generators/CaveAutomata.hs')
-rw-r--r-- | src/Xanthous/Generators/CaveAutomata.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Xanthous/Generators/CaveAutomata.hs b/src/Xanthous/Generators/CaveAutomata.hs index a2f0a165e3c1..fd4c68ddbe90 100644 --- a/src/Xanthous/Generators/CaveAutomata.hs +++ b/src/Xanthous/Generators/CaveAutomata.hs @@ -98,6 +98,7 @@ generate' params dims = do let steps' = params ^. steps when (steps' > 0) $ for_ [0 .. pred steps'] . const $ stepAutomata cells dims params + lift $ fillOuterEdgesM cells pure cells stepAutomata :: forall s g. MCells s -> Dimensions -> Params -> CellM g s () |