Confine use of STATE_NOTFOUND to macros.
[open-adventure.git] / main.c
diff --git a/main.c b/main.c
index 4b6165e4e5acf81fc1f27bb41a0aad0b7f897cbf..b90056c5e04f83bbddd700c3bc85a4d51e3c9f7d 100644 (file)
--- a/main.c
+++ b/main.c
@@ -859,8 +859,8 @@ static bool closecheck(void)
          *  objects come from known locations and/or states (e.g. the
          *  snake is known to have been destroyed and needn't be
          *  carried away from its old "place"), making the various
-         *  objects be handled differently.  We also drop all other
-         *  objects he might be carrying (lest he have some which
+         *  objects be handled differently.  We also drop all other 
+         *  objects he might be acrrying (lest he have some which
          *  could cause trouble, such as the keys).  We describe the
          *  flash of light and trundle back. */
         put(BOTTLE, LOC_NE, EMPTY_BOTTLE);
@@ -868,7 +868,7 @@ static bool closecheck(void)
         put(OYSTER, LOC_NE, STATE_FOUND);
         put(LAMP, LOC_NE, LAMP_DARK);
         put(ROD, LOC_NE, STATE_FOUND);
-        put(DWARF, LOC_NE, 0);
+        put(DWARF, LOC_NE, STATE_FOUND);
         game.loc = LOC_NE;
         game.oldloc = LOC_NE;
         game.newloc = LOC_NE;
@@ -1098,10 +1098,10 @@ static bool do_command(void)
                  *  game.prop < 0 and stash them.  This way objects won't be
                  *  described until they've been picked up and put down
                  *  separate from their respective piles. */
-                if (game.objects[OYSTER].prop < 0 && TOTING(OYSTER))
+                if ((PROP_IS_NOTFOUND(OYSTER) || PROP_IS_STASHED(OYSTER)) && TOTING(OYSTER))
                     pspeak(OYSTER, look, true, 1);
                 for (size_t i = 1; i <= NOBJECTS; i++) {
-                    if (TOTING(i) && game.objects[i].prop < 0)
+                    if (TOTING(i) && (PROP_IS_NOTFOUND(i) || PROP_IS_STASHED(i)))
                         game.objects[i].prop = PROP_STASHED(i);
                 }
             }