mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
Cleanup: remove the `just_used_solve' field from a number of games
which didn't actually need it. It was originally introduced in Fifteen to suppress animation on Solve moves, but midend.c now does that centrally unless the game specifically instructs it otherwise. Therefore, just_used_solve is obsolete in all games which previously used it. (Mines was even worse: it scrupulously maintained the correctness of the field but never used it!) Untangle is exempt from this cleanup: its `just_solved' field is used to change the _length_ of the animation on Solve moves, not to suppress it entirely, and so it has to stay. [originally from svn r6419]
This commit is contained in:
8
mines.c
8
mines.c
@ -58,7 +58,7 @@ struct mine_layout {
|
||||
|
||||
struct game_state {
|
||||
int w, h, n, dead, won;
|
||||
int used_solve, just_used_solve;
|
||||
int used_solve;
|
||||
struct mine_layout *layout; /* real mine positions */
|
||||
signed char *grid; /* player knowledge */
|
||||
/*
|
||||
@ -2169,7 +2169,7 @@ static game_state *new_game(midend *me, game_params *params, char *desc)
|
||||
state->h = params->h;
|
||||
state->n = params->n;
|
||||
state->dead = state->won = FALSE;
|
||||
state->used_solve = state->just_used_solve = FALSE;
|
||||
state->used_solve = FALSE;
|
||||
|
||||
wh = state->w * state->h;
|
||||
|
||||
@ -2274,7 +2274,6 @@ static game_state *dup_game(game_state *state)
|
||||
ret->dead = state->dead;
|
||||
ret->won = state->won;
|
||||
ret->used_solve = state->used_solve;
|
||||
ret->just_used_solve = state->just_used_solve;
|
||||
ret->layout = state->layout;
|
||||
ret->layout->refcount++;
|
||||
ret->grid = snewn(ret->w * ret->h, signed char);
|
||||
@ -2575,13 +2574,12 @@ static game_state *execute_move(game_state *from, char *move)
|
||||
ret->grid[yy*ret->w+xx] = v;
|
||||
}
|
||||
}
|
||||
ret->used_solve = ret->just_used_solve = TRUE;
|
||||
ret->used_solve = TRUE;
|
||||
ret->won = TRUE;
|
||||
|
||||
return ret;
|
||||
} else {
|
||||
ret = dup_game(from);
|
||||
ret->just_used_solve = FALSE;
|
||||
|
||||
while (*move) {
|
||||
if (move[0] == 'F' &&
|
||||
|
Reference in New Issue
Block a user