diff options
| author | Kevin Lyles <kevinlyles@gmail.com> | 2015-05-09 18:51:00 -0500 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2015-05-11 10:46:12 +0100 |
| commit | 3768ed65f281400f5fcdd6e2192e154a6661c0f8 (patch) | |
| tree | 8630debd97222d677180806e0081328e1906b054 | |
| parent | 83318d4218c6eca6535e70f136dd68ff60702eb0 (diff) | |
| download | puzzles-3768ed65f281400f5fcdd6e2192e154a6661c0f8.zip puzzles-3768ed65f281400f5fcdd6e2192e154a6661c0f8.tar.gz puzzles-3768ed65f281400f5fcdd6e2192e154a6661c0f8.tar.bz2 puzzles-3768ed65f281400f5fcdd6e2192e154a6661c0f8.tar.xz | |
Fix the issue with adding only one arrow when the other end was already white
| -rw-r--r-- | galaxies.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -350,6 +350,7 @@ static void add_assoc(const game_state *state, space *tile, space *dot) { } static void add_assoc_with_opposite(game_state *state, space *tile, space *dot) { + int *colors; space *opposite = space_opposite_dot(state, tile, dot); if (opposite == NULL) { @@ -359,6 +360,18 @@ static void add_assoc_with_opposite(game_state *state, space *tile, space *dot) return; } + colors = snewn(state->w * state->h, int); + check_complete(state, NULL, colors); + if (colors[(tile->y - 1)/2 * state->w + (tile->x - 1)/2]) { + sfree(colors); + return; + } + if (colors[(opposite->y - 1)/2 * state->w + (opposite->x - 1)/2]) { + sfree(colors); + return; + } + + sfree(colors); add_assoc(state, tile, dot); add_assoc(state, opposite, dot); } |