From c82d1214fa0de6237e1bece692e2f9f439fa68a9 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 8 Apr 2023 20:02:27 -0400 Subject: [PATCH] First nontrivial replacement of object state test by macro. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions.c b/actions.c index cbc8d3f..4f4ced1 100644 --- 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)) -- 2.31.1