Massage "{oil|water} {plant|door} into equivalent pourcommand.

Bedfore this change the command was passed in OV form, which we want
to get rid of.
This commit is contained in:
Eric S. Raymond 2017-08-03 14:48:44 -04:00
parent 0468da2cdf
commit cfa37c83a7

8
main.c
View file

@ -1123,9 +1123,11 @@ Lclearobj:
} }
if ((command.word[0].id == WATER || command.word[0].id == OIL) && (command.word[1].id == PLANT || command.word[1].id == DOOR)) { if ((command.word[0].id == WATER || command.word[0].id == OIL) && (command.word[1].id == PLANT || command.word[1].id == DOOR)) {
if (AT(command.word[1].id)) { if (AT(command.word[1].id)) {
command.word[1].id = POUR; memcpy(&command.word[1], &command.word[0],
command.word[1].type = ACTION; sizeof(command_word_t));
strncpy(command.word[1].raw, "pour", LINESIZE - 1); command.word[0].id = POUR;
command.word[0].type = ACTION;
strncpy(command.word[0].raw, "pour", LINESIZE - 1);
} }
} }
if (command.word[0].id == CAGE && command.word[1].id == BIRD && HERE(CAGE) && HERE(BIRD)) { if (command.word[0].id == CAGE && command.word[1].id == BIRD && HERE(CAGE) && HERE(BIRD)) {