chiark / gitweb /
Undead: remove an unused structure field.
authorSimon Tatham <anakin@pobox.com>
Wed, 7 Nov 2018 19:16:00 +0000 (19:16 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 7 Nov 2018 19:17:47 +0000 (19:17 +0000)
I noticed that state->common, which is shared between all the game
states in an undo chain, has a 'solved' flag in it. That's not right -
solvedness as a property of a particular state on the chain belongs in
the game_state itself, and having-at-one-point-been-solved-ness as a
persistent property of the whole chain belongs in the game_ui.

Fortunately, the game isn't actually doing it wrong:
state->common->solved is set once and then never read, so it must have
been left in from early abandoned code. Now removed.

undead.c

index 03b014f5a154e0470ca7d5d80b59849a919329e9..6a6b338742ecb566f13b08ddcae7c4874765b154 100644 (file)
--- a/undead.c
+++ b/undead.c
@@ -225,7 +225,6 @@ struct game_common {
     int *grid;
     int *xinfo;
     int *fixed;
-    int solved;
 };
 
 struct game_state {
@@ -260,7 +259,6 @@ static game_state *new_state(const game_params *params) {
     state->common->grid = snewn(state->common->wh, int);
     state->common->xinfo = snewn(state->common->wh, int);
     state->common->fixed = NULL;
-    state->common->solved = FALSE;
 
     state->common->num_paths =
         state->common->params.w + state->common->params.h;