Put the character at the staircase when going down

Always put the character at the up staircase when going down a level,
even when going down to a level we've already generated.
This commit is contained in:
Griffin Smith 2020-01-25 11:06:01 -05:00
parent 5337d7c0eb
commit 2fc4fcfee9

View file

@ -304,6 +304,7 @@ handleCommand GoDown = do
pCharacter <- entities . at cEID <<.= Nothing pCharacter <- entities . at cEID <<.= Nothing
levels .= levs' levels .= levs'
entities . at cEID .= pCharacter entities . at cEID .= pCharacter
characterPosition .= extract levs' ^. upStaircasePosition
else say_ ["cant", "goDown"] else say_ ["cant", "goDown"]
continue continue
@ -599,7 +600,6 @@ genLevel _num = do
level <- case generator of level <- case generator of
CaveAutomata -> generateLevel SCaveAutomata CaveAutomata.defaultParams dims CaveAutomata -> generateLevel SCaveAutomata CaveAutomata.defaultParams dims
Dungeon -> generateLevel SDungeon Dungeon.defaultParams dims Dungeon -> generateLevel SDungeon Dungeon.defaultParams dims
characterPosition .= level ^. levelCharacterPosition
pure $!! level pure $!! level
levelToGameLevel :: Level -> GameLevel levelToGameLevel :: Level -> GameLevel