Massage "{oil|water} {plant|door} into equivalent pourcommand.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 3 Aug 2017 18:48:44 +0000 (14:48 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 3 Aug 2017 18:48:44 +0000 (14:48 -0400)
Bedfore this change the command was passed in OV form, which we want
to get rid of.

main.c

diff --git a/main.c b/main.c
index a57694e3fb110e5e01a1ee73ae90d3cb85de9375..a20d9dc2e5114210594fc126f7ba0c0323dd1ebb 100644 (file)
--- a/main.c
+++ b/main.c
@@ -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 (AT(command.word[1].id)) {
-                    command.word[1].id = POUR;
-                    command.word[1].type = ACTION;
-                    strncpy(command.word[1].raw, "pour", LINESIZE - 1);
+                   memcpy(&command.word[1], &command.word[0],
+                          sizeof(command_word_t));
+                   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)) {