First nontrivial replacement of object state test by macro.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 9 Apr 2023 00:02:27 +0000 (20:02 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 9 Apr 2023 00:02:27 +0000 (20:02 -0400)
Test was game.objects[i].prop >= 0, but we know that state -1
(STATE_NOTFOUND) can't occiur here because the object is in
a lit room.

actions.c

index cbc8d3ff59b1ee6d0f45066d75182f4286ef489c..4f4ced179ff66c4687a42d797ff514fdb7ce8ffe 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -1099,7 +1099,7 @@ static phase_codes_t read(command_t command)
     if (command.obj == INTRANSITIVE) {
         command.obj = NO_OBJECT;
         for (int i = 1; i <= NOBJECTS; i++) {
-            if (HERE(i) && objects[i].texts[0] != NULL && game.objects[i].prop >= 0)
+            if (HERE(i) && objects[i].texts[0] != NULL && !PROP_IS_STASHED(i))
                 command.obj = command.obj * NOBJECTS + i;
         }
         if (command.obj > NOBJECTS || command.obj == NO_OBJECT || DARK(game.loc))