I arranged that dying after the game was already completed didn't
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 6 Sep 2005 22:28:04 +0000 (22:28 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 6 Sep 2005 22:28:04 +0000 (22:28 +0000)
increment the deaths counter. In doing so, I incorrectly handled the
borderline case, so that a death incurred _in the act_ of collecting
the final gem also didn't increment the deaths counter. Now it does.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6277 cda61777-01e9-0310-a592-d414129be87e

inertia.c

index b490e04..e03db7e 100644 (file)
--- a/inertia.c
+++ b/inertia.c
@@ -710,11 +710,11 @@ static void game_changed_state(game_ui *ui, game_state *oldstate,
     /*
      * Increment the deaths counter. We only do this if
      * ui->just_made_move is set (redoing a suicide move doesn't
     /*
      * Increment the deaths counter. We only do this if
      * ui->just_made_move is set (redoing a suicide move doesn't
-     * kill you _again_), and also we only do it if the game isn't
-     * completed (once you're finished, you can play).
+     * kill you _again_), and also we only do it if the game wasn't
+     * already completed (once you're finished, you can play).
      */
     if (!oldstate->dead && newstate->dead && ui->just_made_move &&
      */
     if (!oldstate->dead && newstate->dead && ui->just_made_move &&
-       newstate->gems) {
+       oldstate->gems) {
        ui->deaths++;
        ui->just_died = TRUE;
     } else {
        ui->deaths++;
        ui->just_died = TRUE;
     } else {