shithub: puzzles

Download patch

ref: 899c7c41efb2bcc8da8121cc7a8f4fccf5eb9b1e
parent: 462a5450c6bd7d96a6051b37ceef1fd63426ddf8
author: Ben Harris <[email protected]>
date: Sun Aug 13 21:55:42 EDT 2023

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.

--- a/flood.c
+++ b/flood.c
@@ -845,9 +845,9 @@
     } 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;
     }