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
Forbid undo of new-game if it would change the params.
[sgt-puzzles.git]
/
galaxies.c
diff --git
a/galaxies.c
b/galaxies.c
index 330b6bb3d287a399e5f7512a260d178c849c2192..f4f75c629c7889b506b48c7c36f087e939003a37 100644
(file)
--- a/
galaxies.c
+++ b/
galaxies.c
@@
-373,7
+373,9
@@
static void add_assoc_with_opposite(game_state *state, space *tile, space *dot)
}
sfree(colors);
}
sfree(colors);
+ remove_assoc_with_opposite(state, tile);
add_assoc(state, tile, dot);
add_assoc(state, tile, dot);
+ remove_assoc_with_opposite(state, opposite);
add_assoc(state, opposite, dot);
}
add_assoc(state, opposite, dot);
}
@@
-1299,6
+1301,8
@@
generate:
game_update_dots(state);
game_update_dots(state);
+ if (state->ndots == 1) goto generate;
+
#ifdef DEBUGGING
{
char *tmp = encode_game(state);
#ifdef DEBUGGING
{
char *tmp = encode_game(state);
@@
-2589,7
+2593,7
@@
static char *interpret_move(const game_state *state, game_ui *ui,
if (INUI(state, px, py)) {
sp = &SPACE(state, px, py);
if (INUI(state, px, py)) {
sp = &SPACE(state, px, py);
- if (!(sp->flags & F_DOT)
&& !(sp->flags & F_TILE_ASSOC)
)
+ if (!(sp->flags & F_DOT))
sprintf(buf + strlen(buf), "%sA%d,%d,%d,%d",
sep, px, py, ui->dotx, ui->doty);
}
sprintf(buf + strlen(buf), "%sA%d,%d,%d,%d",
sep, px, py, ui->dotx, ui->doty);
}
@@
-3629,7
+3633,7
@@
static void game_print(drawing *dr, const game_state *state, int sz)
const struct game thegame = {
"Galaxies", "games.galaxies", "galaxies",
default_params,
const struct game thegame = {
"Galaxies", "games.galaxies", "galaxies",
default_params,
- game_fetch_preset,
+ game_fetch_preset,
NULL,
decode_params,
encode_params,
free_params,
decode_params,
encode_params,
free_params,