X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=actions.c;h=bc442de600dd72209a3219a0256c6813e4c24ad6;hb=4da9742cd28e87ea91d3a7b75e3d7147011b95e7;hp=682b03bd6cdecfa66e59203e967ef6552baf8cc8;hpb=29b8f5b142d15f75cf37fc9c2cfd4b549d18d2d4;p=open-adventure.git diff --git a/actions.c b/actions.c index 682b03b..bc442de 100644 --- a/actions.c +++ b/actions.c @@ -930,8 +930,7 @@ static int listen(void) * depending on whether player has drunk dragon's blood. */ if (i == BIRD) mi += 3 * game.blooded; - long packed_zzword = token_to_packed(game.zzword); - pspeak(i, hear, mi, true, packed_zzword); + pspeak(i, hear, mi, true, game.zzword); rspeak(NO_MESSAGE); if (i == BIRD && mi == BIRD_ENDSTATE) DESTROY(BIRD); @@ -1145,18 +1144,19 @@ static int rub(verb_t verb, obj_t obj) static int say(struct command_t *command) /* Say. Echo WD2. Magic words override. */ { - long wd; - enum wordtype type; - get_vocab_metadata(command->raw2, &wd, &type); - if (wd == XYZZY || - wd == PLUGH || - wd == PLOVER || - wd == FEE || - wd == FIE || - wd == FOE || - wd == FOO || - wd == FUM || - wd == PART) { + if (command->type2 == MOTION && + (command->id2 == XYZZY || + command->id2 == PLUGH || + command->id2 == PLOVER)) { + return GO_WORD2; + } + if (command->type2 == ACTION && + (command->id2 == FEE || + command->id2 == FIE || + command->id2 == FOE || + command->id2 == FOO || + command->id2 == FUM || + command->id2 == PART)) { return GO_WORD2; } sspeak(OKEY_DOKEY, command->raw2); @@ -1355,7 +1355,10 @@ int action(struct command_t *command) if (command->raw2[0] != '\0' && command->verb != SAY) return GO_WORD2; if (command->verb == SAY) - command->obj = command->wd2; + /* KEYS is not special, anything not NO_OBJECT or INTRANSITIVE + * will do here. We're preventing interpretation as an intransitive + * verb when the word is unknown. */ + command->obj = command->raw2[0] != '\0' ? KEYS : NO_OBJECT; if (command->obj == NO_OBJECT || command->obj == INTRANSITIVE) { /* Analyse an intransitive verb (ie, no object given yet). */