chiark
/
gitweb
/
~ian
/
sgt-puzzles.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix borders on the HTML menu bar.
[sgt-puzzles.git]
/
tracks.c
diff --git
a/tracks.c
b/tracks.c
index 2fefe36ddd4f575a384e42919e803a2f5606b89c..43428a19e92b95cac1b551ebea0225d766bb3ee9 100644
(file)
--- a/
tracks.c
+++ b/
tracks.c
@@
-1072,7
+1072,7
@@
static int solve_check_single_sub(game_state *state, int si, int id, int n,
x = i%w;
y = i/w;
if (abs(ox-x) > 1 || abs(oy-y) > 1) {
x = i%w;
y = i/w;
if (abs(ox-x) > 1 || abs(oy-y) > 1) {
- if (!
state->sflags[i] & S_TRACK
)
+ if (!
(state->sflags[i] & S_TRACK)
)
did += solve_set_sflag(state, x, y, S_NOTRACK, what);
}
}
did += solve_set_sflag(state, x, y, S_NOTRACK, what);
}
}
@@
-1551,8
+1551,10
@@
static int check_completion(game_state *state, int mark)
for (i = 0; i < w*h; i++) {
state->sflags[i] &= ~S_ERROR;
if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0) {
for (i = 0; i < w*h; i++) {
state->sflags[i] &= ~S_ERROR;
if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0) {
- if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 2)
+ if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 2) {
+ ret = FALSE;
state->sflags[i] |= S_ERROR;
state->sflags[i] |= S_ERROR;
+ }
}
}
}
}
}
}
@@
-1579,6
+1581,7
@@
static int check_completion(game_state *state, int mark)
debug(("col %d error: target %d, track %d, notrack %d",
x, target, ntrack, nnotrack));
state->num_errors[x] = 1;
debug(("col %d error: target %d, track %d, notrack %d",
x, target, ntrack, nnotrack));
state->num_errors[x] = 1;
+ ret = FALSE;
}
}
if (ntrackcomplete != target)
}
}
if (ntrackcomplete != target)
@@
-1601,6
+1604,7
@@
static int check_completion(game_state *state, int mark)
debug(("row %d error: target %d, track %d, notrack %d",
y, target, ntrack, nnotrack));
state->num_errors[w+y] = 1;
debug(("row %d error: target %d, track %d, notrack %d",
y, target, ntrack, nnotrack));
state->num_errors[w+y] = 1;
+ ret = FALSE;
}
}
if (ntrackcomplete != target)
}
}
if (ntrackcomplete != target)
@@
-1651,6
+1655,12
@@
static int check_completion(game_state *state, int mark)
state->sflags[i] |= S_ERROR;
}
}
state->sflags[i] |= S_ERROR;
}
}
+ } else {
+ /* If we _don't_ have such a path, then certainly the game
+ * can't be in a winning state. So even if we're not
+ * highlighting any _errors_, we certainly shouldn't
+ * return true. */
+ ret = FALSE;
}
}
}
}
@@
-2612,7
+2622,7
@@
static void game_print(drawing *dr, const game_state *state, int tilesize)
const struct game thegame = {
"Train Tracks", "games.tracks", "tracks",
default_params,
const struct game thegame = {
"Train Tracks", "games.tracks", "tracks",
default_params,
- game_fetch_preset,
+ game_fetch_preset,
NULL,
decode_params,
encode_params,
free_params,
decode_params,
encode_params,
free_params,