Add a missing error message in Flood solve_game().

The only situation in which it actually can't find a solution is if
the puzzle is already solved, in which case it can at least fill in
*error to say so before it returns NULL.
This commit is contained in:
Simon Tatham
2015-12-24 22:05:48 +00:00
parent f1af73319f
commit d295a8a93c

View File

@ -697,8 +697,10 @@ static char *solve_game(const game_state *state, const game_state *currstate,
char buf[256]; char buf[256];
struct solver_scratch *scratch; struct solver_scratch *scratch;
if (currstate->complete) if (currstate->complete) {
*error = "Puzzle is already solved";
return NULL; return NULL;
}
/* /*
* Find the best solution our solver can give. * Find the best solution our solver can give.