From: Eric S. Raymond Date: Thu, 20 Jul 2017 14:13:15 +0000 (-0400) Subject: Remove unneeded vocabulary lookup. X-Git-Tag: 1.3~40 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=78ba0fac6a7ca5596c8fe65aeb32d9f5d66d1a08;p=open-adventure.git Remove unneeded vocabulary lookup. --- diff --git a/main.c b/main.c index 1a1f25d..fd8a298 100644 --- a/main.c +++ b/main.c @@ -1024,7 +1024,6 @@ static bool do_command() /* Get and execute a command */ { static struct command_t command; - char word1[TOKLEN + 1]; command.verb = 0; @@ -1156,10 +1155,6 @@ Lookup: if (++game.igo == 10) rspeak(GO_UNNEEDED); } - packed_to_token(command.wd1, word1); - long defn; - enum wordtype type; - get_vocab_metadata(word1, &defn, &type); if (command.id1 == WORD_NOT_FOUND) { if (fallback_handler(command)) continue; @@ -1167,7 +1162,7 @@ Lookup: sspeak(DONT_KNOW, command.raw1); goto Lclearobj; } - switch (type) { + switch (command.type1) { case NO_WORD_TYPE: // FIXME: treating NO_WORD_TYPE as a motion word is confusing case MOTION: playermove(command.id1); @@ -1178,7 +1173,7 @@ Lookup: break; case ACTION: command.part = intransitive; - command.verb = defn; + command.verb = command.id1; break; case SPECIAL: speak(specials[command.id1].message);