Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.
This repository was archived by the owner on May 27, 2021. It is now read-only.

Extra turn spent when auto-travelling into obstacles #33

@tung

Description

@tung

Rather than describe it in bug form, I'll just quote how I fixed it.

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.

tung@4f43437

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions