aboutsummaryrefslogtreecommitdiff
path: root/filling.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2007-02-25 13:00:58 +0000
committerSimon Tatham <anakin@pobox.com>2007-02-25 13:00:58 +0000
commita7408203eb9a3720cd9a7828253de844faf3ce44 (patch)
treee8955627bb5c7cf4b98647278a859be079eaf752 /filling.c
parentb9fd636928ac476b232d6854e32305392764217c (diff)
downloadpuzzles-a7408203eb9a3720cd9a7828253de844faf3ce44.zip
puzzles-a7408203eb9a3720cd9a7828253de844faf3ce44.tar.gz
puzzles-a7408203eb9a3720cd9a7828253de844faf3ce44.tar.bz2
puzzles-a7408203eb9a3720cd9a7828253de844faf3ce44.tar.xz
Don't create an undo-chain entry for a move with no effect.
[originally from svn r7333]
Diffstat (limited to 'filling.c')
-rw-r--r--filling.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/filling.c b/filling.c
index ac5b6d9..82efcca 100644
--- a/filling.c
+++ b/filling.c
@@ -962,9 +962,13 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
{
const int i = w*ui->y + ui->x;
char buf[64];
- sprintf(buf, "%d_%d", i, button);
ui->x = ui->y = -1;
- return dupstr(buf);
+ if (state->board[i] == button) {
+ return ""; /* no change - just update ui */
+ } else {
+ sprintf(buf, "%d_%d", i, button);
+ return dupstr(buf);
+ }
}
}