-Lookup:
- if (strncasecmp(command.word[0].raw, "west", sizeof("west")) == 0) {
- if (++game.iwest == 10)
- rspeak(W_IS_WEST);
- }
- if (strncasecmp(command.word[0].raw, "go", sizeof("go")) == 0 && command.word[1].id != WORD_EMPTY) {
- if (++game.igo == 10)
- rspeak(GO_UNNEEDED);
- }
- if (command.word[0].id == WORD_NOT_FOUND) {
- /* Gee, I don't understand. */
- sspeak(DONT_KNOW, command.word[0].raw);
- clear_command(&command);
- goto Lcheckhint;
- }
- switch (command.word[0].type) {
- case NO_WORD_TYPE: // FIXME: treating NO_WORD_TYPE as a motion word is confusing
- case MOTION:
- playermove(command.word[0].id);
- return true;
- case OBJECT:
- command.part = unknown;
- command.obj = command.word[0].id;
- break;
- case ACTION:
- if (command.word[1].type == NUMERIC)
- command.part = transitive;
- else
- command.part = intransitive;
- command.verb = command.word[0].id;
- break;
- case NUMERIC:
- if (!settings.oldstyle) {
- sspeak(DONT_KNOW, command.word[0].raw);
- clear_command(&command);
- goto Lcheckhint;
- }
- default: // LCOV_EXCL_LINE
- BUG(VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3); // LCOV_EXCL_LINE
- }
- switch (action(command)) {
- case GO_TERMINATE:
- return true;
- case GO_MOVE:
- playermove(NUL);
- return true;
- case GO_TOP:
- continue; /* back to top of main interpreter loop */
- case GO_CLEAROBJ:
- clear_command(&command);
- /* FALL THROUGH */
- case GO_CHECKHINT:
- goto Lcheckhint;
- case GO_WORD2:
+ // loop until all words in command are procesed
+ do {
+ // assume all words in command are processed, until proven otherwise
+ words_processed = true;
+
+ if (strncasecmp(command.word[0].raw, "west", sizeof("west")) == 0) {
+ if (++game.iwest == 10)
+ rspeak(W_IS_WEST);
+ }
+ if (strncasecmp(command.word[0].raw, "go", sizeof("go")) == 0 && command.word[1].id != WORD_EMPTY) {
+ if (++game.igo == 10)
+ rspeak(GO_UNNEEDED);
+ }
+ if (command.word[0].id == WORD_NOT_FOUND) {
+ /* Gee, I don't understand. */
+ sspeak(DONT_KNOW, command.word[0].raw);
+ clear_command(&command);
+ goto Lcheckhint;
+ }
+
+ switch (command.word[0].type) {
+ case NO_WORD_TYPE: // FIXME: treating NO_WORD_TYPE as a motion word is confusing
+ case MOTION:
+ playermove(command.word[0].id);
+ return true;
+ case OBJECT:
+ command.part = unknown;
+ command.obj = command.word[0].id;
+ break;
+ case ACTION:
+ if (command.word[1].type == NUMERIC)
+ command.part = transitive;
+ else
+ command.part = intransitive;
+ command.verb = command.word[0].id;
+ break;
+ case NUMERIC:
+ if (!settings.oldstyle) {
+ sspeak(DONT_KNOW, command.word[0].raw);
+ clear_command(&command);
+ goto Lcheckhint;
+ }
+ default: // LCOV_EXCL_LINE
+ BUG(VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3); // LCOV_EXCL_LINE
+ }
+
+ switch (action(command)) {
+ case GO_TERMINATE:
+ return true;
+ case GO_MOVE:
+ playermove(NUL);
+ return true;
+ case GO_TOP:
+ continue; /* back to top of main interpreter loop */
+ case GO_CLEAROBJ:
+ clear_command(&command);
+ /* FALL THROUGH */
+ case GO_CHECKHINT:
+ goto Lcheckhint;
+ case GO_WORD2: