Simplify initialization code. All tests pass, 100% coverage.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 14 Apr 2023 12:13:24 +0000 (08:13 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 14 Apr 2023 12:24:51 +0000 (08:24 -0400)
init.c

diff --git a/init.c b/init.c
index 0813fb7ce493764f052a5a5dab397830eb6aafa3..532f2716db78ca3ad6f041241c1f011e6fbd4552 100644 (file)
--- a/init.c
+++ b/init.c
@@ -89,9 +89,9 @@ int initialise(void)
      *  not yet found, so we know when to close the cave. */
     for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
         if (objects[treasure].is_treasure) {
+            ++game.tally;
             if (objects[treasure].inventory != 0)
                 PROP_SET_NOT_FOUND(treasure);
-            game.tally = game.tally - game.objects[treasure].prop;
         }
     }
     game.conds = setbit(COND_HBASE);