mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
Range: Don't fail an assertion on an all-black board
If there are no white squares, then Range's check that all the white squares form a connected component goes wrong. Skip the check in that case to avoid an assretion violation ("edsf_canonify: Assertion `index >= 0' failed."). This can be demonstrated by starting a game with no clues (e.g. "range 3:i") and then filling in every square.
This commit is contained in:
3
range.c
3
range.c
@ -1494,7 +1494,8 @@ static bool find_errors(const game_state *state, bool *report)
|
||||
if (state->grid[r*w+c] != BLACK &&
|
||||
state->grid[r*w+(c+1)] != BLACK)
|
||||
dsf_merge(dsf, r*w+c, r*w+(c+1));
|
||||
if (nblack + dsf_size(dsf, any_white_cell) < n) {
|
||||
if (any_white_cell != -1 &&
|
||||
nblack + dsf_size(dsf, any_white_cell) < n) {
|
||||
int biggest, canonical;
|
||||
|
||||
if (!report) {
|
||||
|
Reference in New Issue
Block a user