X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=actions.c;h=c5f06e59f2b96d16039caa78defd156fae6e7b02;hb=c3a2816821512b59a09866a594a9bec699193271;hp=16ed7ca7f35b1cc52f69764ae78305e74b038030;hpb=3a93b2b5f08351c3e87d4f41c5c61273c42e9420;p=open-adventure.git diff --git a/actions.c b/actions.c index 16ed7ca..c5f06e5 100644 --- a/actions.c +++ b/actions.c @@ -804,7 +804,7 @@ static int read(struct command_t command) if (command.obj == INTRANSITIVE) { command.obj = 0; for (int i = 1; i <= NOBJECTS; i++) { - if (HERE(i) && OBJTXT[i] != 0 && game.prop[i] >= 0) + if (HERE(i) && object_descriptions[i].texts[0] != NULL && game.prop[i] >= 0) command.obj = command.obj * NOBJECTS + i; } if (command.obj > NOBJECTS || command.obj == 0 || DARK(game.loc)) @@ -815,7 +815,7 @@ static int read(struct command_t command) rspeak(NO_SEE, command.wd1, command.wd1x); } else if (command.obj == OYSTER && !game.clshnt && game.closed) { game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]); - } else if (OBJTXT[command.obj] == 0 || game.prop[command.obj] < 0) { + } else if (object_descriptions[command.obj].texts[0] == NULL || game.prop[command.obj] < 0) { rspeak(ACTSPK[command.verb]); } else pspeak(command.obj, study, game.prop[command.obj]); @@ -899,7 +899,7 @@ static int throw (FILE *cmdin, struct command_t *command) rspeak(spk); return GO_CLEAROBJ; } - if (command->obj >= MINTRS && command->obj <= MAXTRS && AT(TROLL)) { + if (object_descriptions[command->obj].is_treasure && AT(TROLL)) { spk = TROLL_SATISFIED; /* Snarf a treasure for the troll. */ DROP(command->obj, 0);