aboutsummaryrefslogtreecommitdiff
path: root/unequal.c
diff options
context:
space:
mode:
Diffstat (limited to 'unequal.c')
-rw-r--r--unequal.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/unequal.c b/unequal.c
index 5e9994f..c1d3a30 100644
--- a/unequal.c
+++ b/unequal.c
@@ -1612,6 +1612,25 @@ static char *interpret_move(const game_state *state, game_ui *ui,
if (ui->hpencil && GRID(state, nums, ui->hx, ui->hy) > 0)
return NULL; /* can't change hints on filled square (!) */
+ /*
+ * If you ask to fill a square with what it already contains,
+ * or blank it when it's already empty, that has no effect...
+ */
+ if ((!ui->hpencil || n == 0) &&
+ GRID(state, nums, ui->hx, ui->hy) == n) {
+ bool anypencil = false;
+ int i;
+ for (i = 0; i < state->order; i++)
+ anypencil = anypencil || HINT(state, ui->hx, ui->hy, i);
+ if (!anypencil) {
+ /* ... expect to remove the cursor in mouse mode. */
+ if (!ui->hcursor) {
+ ui->hshow = false;
+ return UI_UPDATE;
+ }
+ return NULL;
+ }
+ }
sprintf(buf, "%c%d,%d,%d",
(char)(ui->hpencil && n > 0 ? 'P' : 'R'), ui->hx, ui->hy, n);