diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-06-04 19:02:21 +0100 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-06-11 00:33:27 +0100 |
| commit | a943f3177f4adc591a282bdc62eef80675dc2a67 (patch) | |
| tree | 5dd465a8f303fe0d4246c4f161fb2466ee1b374a /midend.c | |
| parent | a9af3fda1d784c42d486a019a0a4e947f762af70 (diff) | |
| download | puzzles-a943f3177f4adc591a282bdc62eef80675dc2a67.zip puzzles-a943f3177f4adc591a282bdc62eef80675dc2a67.tar.gz puzzles-a943f3177f4adc591a282bdc62eef80675dc2a67.tar.bz2 puzzles-a943f3177f4adc591a282bdc62eef80675dc2a67.tar.xz | |
Add MOVE_NO_EFFECT and MOVE_UNUSED return values from interpret_move()
These allow for distinguishing the case where a puzzle doesn't have a
use for a key from the case where it just happens to have no effect in
the current state of the puzzle. These were both represented by NULL,
but that now represents the case where a puzzle hasn't been updated to
make the distinction yet.
Diffstat (limited to 'midend.c')
| -rw-r--r-- | midend.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -990,7 +990,7 @@ static bool midend_really_process_key(midend *me, int x, int y, int button, me->ui, me->drawstate, x, y, button); } - if (!movestr) { + if (movestr == NULL || movestr == MOVE_UNUSED) { if ((me->one_key_shortcuts && (button == 'n' || button == 'N')) || button == '\x0E' || button == UI_NEWGAME) { midend_new_game(me); @@ -1025,6 +1025,8 @@ static bool midend_really_process_key(midend *me, int x, int y, int button, goto done; } else goto done; + } else if (movestr == MOVE_NO_EFFECT) { + goto done; } else { *handled = true; if (movestr == MOVE_UI_UPDATE) |