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_status(game_state *state)
+{
+ /*
+ * 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)
{
if (state->dead || state->won || ui->completed || !state->layout->mines)
game_redraw,
game_anim_length,
game_flash_length,
+ game_status,
FALSE, FALSE, game_print_size, game_print,
TRUE, /* wants_statusbar */
TRUE, game_timing_state,