forked from DanielT/NitroHack
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix extra turn spent travelling into obstacles
This actually fixes two closely-related bugs: travelling into a wall when adjacent to it, and when not adjacent to it. In both cases, you must target the stone behind the wall to trigger the bug. The core problem was that domove() was continuing to do moving logic after travelling hit an obstacle, causing it to return 1 even though the player hadn't moved. From there, travelling into a wall when next to it spent a turn because it itself always returned 1 instead of the result of domove(). Travelling into a wall when not starting next to it spent a turn because the result of domove() in command_input() didn't set flags.move to 0 like do_command() normally does. This also removes useless lines in domove() that set flags.move to 0, since NitroHack already does this when a command function returns 0. This bug also exists in upstream NitroHack.
- Loading branch information
Showing
3 changed files
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters