Skip to content

Conversation

@tung
Copy link

@tung tung commented Jun 15, 2015

This fixes a bug in level flipping where stairs and ladders in their sentinel positions (i.e. x = 0) were being flipped out of them when SporkHack generated random vaults that allowed the level to be flipped (yes, the placement of a single vault can flip THE ENTIRE LEVEL).

This bug could be seen most often when starting a new game, where the upstair is sstairs (special/branch stairs; a comment in use_defensive() claims otherwise, but gdb proves it wrong). The start-of-game code calls u_on_upstairs(), which is supposed to put the player on these stairs but instead prioritizes the regular upstairs that have been flipped from x = 0 to x = 79, thus starting the player in the corner of the level surrounded by rock.

This fixes a bug in level flipping where stairs and ladders in their
sentinel positions (i.e. x = 0) were being flipped out of them when
SporkHack generated random vaults that allowed the level to be flipped
(yes, the placement of a single vault can flip THE ENTIRE LEVEL).

This bug could be seen most often when starting a new game, where the
upstair is `sstairs` (special/branch stairs; a comment in
`use_defensive()` claims otherwise, but gdb proves it wrong).  The
start-of-game code calls `u_on_upstairs()`, which is supposed to put the
player on these stairs but instead prioritizes the regular upstairs that
have been flipped from x = 0 to x = 79, thus starting the player in the
corner of the level surrounded by rock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant