mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 08:25:45 -07:00
Don't create an undo-chain entry for a move with no effect.
[originally from svn r7333]
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user