aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2016-02-24 19:18:30 +0000
committerSimon Tatham <anakin@pobox.com>2016-02-24 19:18:30 +0000
commit755c3d5277262739e8beb03da3649e7f4d53e915 (patch)
tree41c04254c0273b61d779221fc71d961da895df7e
parent01844d39c6c92d5ce417519ef2bdced6346f2549 (diff)
downloadpuzzles-755c3d5277262739e8beb03da3649e7f4d53e915.zip
puzzles-755c3d5277262739e8beb03da3649e7f4d53e915.tar.gz
puzzles-755c3d5277262739e8beb03da3649e7f4d53e915.tar.bz2
puzzles-755c3d5277262739e8beb03da3649e7f4d53e915.tar.xz
Tracks: tighten up a small loophole in completion checking.
If you had a single connected path linking the source to the destination but _also_ had a spurious edge elsewhere in the grid, then the spurious edge would be highlighted as an error, but it wouldn't inhibit declaring the game complete and showing the victory flash.
-rw-r--r--tracks.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tracks.c b/tracks.c
index d633a9c..2fefe36 100644
--- a/tracks.c
+++ b/tracks.c
@@ -1646,8 +1646,10 @@ static int check_completion(game_state *state, int mark)
for (i = 0; i < w*h; i++) {
if ((dsf_canonify(dsf, i) != pathclass) &&
((state->sflags[i] & S_TRACK) ||
- (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0)))
+ (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0))) {
+ ret = FALSE;
state->sflags[i] |= S_ERROR;
+ }
}
}
}