diff options
| author | Simon Tatham <anakin@pobox.com> | 2007-02-25 13:00:58 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2007-02-25 13:00:58 +0000 |
| commit | a7408203eb9a3720cd9a7828253de844faf3ce44 (patch) | |
| tree | e8955627bb5c7cf4b98647278a859be079eaf752 /filling.c | |
| parent | b9fd636928ac476b232d6854e32305392764217c (diff) | |
| download | puzzles-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.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); + } } } |