From 899c7c41efb2bcc8da8121cc7a8f4fccf5eb9b1e Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 14 Aug 2023 01:55:42 +0100 Subject: [PATCH] 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. --- flood.c | 6 +++--- 1 file 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; }