aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-08-14 01:55:42 +0100
committerBen Harris <bjh21@bjh21.me.uk>2023-08-14 01:55:42 +0100
commit899c7c41efb2bcc8da8121cc7a8f4fccf5eb9b1e (patch)
tree4b58de311f1ca0b3e4035e34d19ac42e8035a508
parent462a5450c6bd7d96a6051b37ceef1fd63426ddf8 (diff)
downloadpuzzles-899c7c41efb2bcc8da8121cc7a8f4fccf5eb9b1e.zip
puzzles-899c7c41efb2bcc8da8121cc7a8f4fccf5eb9b1e.tar.gz
puzzles-899c7c41efb2bcc8da8121cc7a8f4fccf5eb9b1e.tar.bz2
puzzles-899c7c41efb2bcc8da8121cc7a8f4fccf5eb9b1e.tar.xz
Flood: fix interpret_move() return value for CURSOR_SELECT2
If there's no solution in progress, it should return MOVE_NO_EFFECT, not MOVE_UNUSED.
-rw-r--r--flood.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/flood.c b/flood.c
index e8ff167..bef45f3 100644
--- a/flood.c
+++ b/flood.c
@@ -845,9 +845,9 @@ static char *interpret_move(const game_state *state, game_ui *ui,
} else if (button == CURSOR_SELECT) {
tx = ui->cx;
ty = ui->cy;
- } else if (button == CURSOR_SELECT2 &&
- state->soln && state->solnpos < state->soln->nmoves) {
- move = state->soln->moves[state->solnpos];
+ } else if (button == CURSOR_SELECT2) {
+ if (state->soln && state->solnpos < state->soln->nmoves)
+ move = state->soln->moves[state->solnpos];
} else {
return MOVE_UNUSED;
}