Minimal (i.e., lame) update to Loopy documentation to match reality -- it's
[sgt/puzzles] / inertia.c
index 055d264..6531b98 100644 (file)
--- a/inertia.c
+++ b/inertia.c
@@ -735,6 +735,18 @@ static char *solve_game(game_state *state, game_state *currstate,
     char *err, *soln, *p;
 
     /*
+     * Before anything else, deal with the special case in which
+     * all the gems are already collected.
+     */
+    for (i = 0; i < wh; i++)
+       if (currstate->grid[i] == GEM)
+           break;
+    if (i == wh) {
+       *error = "Game is already solved";
+       return NULL;
+    }
+
+    /*
      * Solving Inertia is a question of first building up the graph
      * of where you can get to from where, and secondly finding a
      * tour of the graph which takes in every gem.
@@ -1692,7 +1704,7 @@ static void game_set_size(drawing *dr, game_drawstate *ds,
     ds->player_background = blitter_new(dr, TILESIZE, TILESIZE);
 }
 
-static float *game_colours(frontend *fe, game_state *state, int *ncolours)
+static float *game_colours(frontend *fe, int *ncolours)
 {
     float *ret = snewn(3 * NCOLOURS, float);
     int i;
@@ -2122,11 +2134,6 @@ static float game_flash_length(game_state *oldstate, game_state *newstate,
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -2176,7 +2183,7 @@ const struct game thegame = {
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,                             /* wants_statusbar */
     FALSE, game_timing_state,
     0,                                /* flags */
 };