static game_state *new_game(midend *me, game_params *params, char *desc)
{
game_state *state = snew(game_state);
- int i, wh, x, y, ret, masked;
+ int i, wh, x, y, masked;
unsigned char *bmp;
state->w = params->w;
}
if (x >= 0 && y >= 0)
- ret = open_square(state, x, y);
+ open_square(state, x, y);
sfree(bmp);
}
return 0.0F;
}
-static int game_is_solved(game_state *state)
+static int game_status(game_state *state)
{
- return state->won;
+ /*
+ * We report the game as lost only if the player has used the
+ * Solve function to reveal all the mines. Otherwise, we assume
+ * they'll undo and continue play.
+ */
+ return state->won ? (state->used_solve ? -1 : +1) : 0;
}
static int game_timing_state(game_state *state, game_ui *ui)
game_redraw,
game_anim_length,
game_flash_length,
- game_is_solved,
+ game_status,
FALSE, FALSE, game_print_size, game_print,
TRUE, /* wants_statusbar */
TRUE, game_timing_state,