Apply "103_fix-unequal-digit-h.diff" from the Debian package:
[sgt/puzzles] / unequal.c
index 91ae118..20fc2d2 100644 (file)
--- a/unequal.c
+++ b/unequal.c
@@ -408,6 +408,11 @@ static int c2n(int c, int order) {
     return -1;
 }
 
+static int game_can_format_as_text_now(game_params *params)
+{
+    return TRUE;
+}
+
 static char *game_text_format(game_state *state)
 {
     int x, y, len, n;
@@ -1266,7 +1271,8 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
 
     button &= ~MOD_MASK;
 
-    if (x >= 0 && x < ds->order && y >= 0 && y < ds->order) {
+    if (x >= 0 && x < ds->order && ((ox - COORD(x)) <= TILE_SIZE) &&
+        y >= 0 && y < ds->order && ((oy - COORD(y)) <= TILE_SIZE)) {
         if (button == LEFT_BUTTON) {
             /* normal highlighting for non-immutable squares */
             if (GRID(state, flags, x, y) & F_IMMUTABLE)
@@ -1290,8 +1296,6 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
             return "";
         }
     }
-    if (button == 'H' || button == 'h')
-        return dupstr("H");
 
     if (ui->hx != -1 && ui->hy != -1) {
         debug(("button %d, cbutton %d", button, (int)((char)button)));
@@ -1317,6 +1321,10 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
 
         return dupstr(buf);
     }
+
+    if (button == 'H' || button == 'h')
+        return dupstr("H");
+
     return NULL;
 }
 
@@ -1735,7 +1743,7 @@ const struct game thegame = {
     dup_game,
     free_game,
     TRUE, solve_game,
-    TRUE, game_text_format,
+    TRUE, game_can_format_as_text_now, game_text_format,
     new_ui,
     free_ui,
     encode_ui,