From: Eric S. Raymond Date: Thu, 3 Aug 2017 18:48:44 +0000 (-0400) Subject: Massage "{oil|water} {plant|door} into equivalent pourcommand. X-Git-Tag: 1.4~4 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=cfa37c83a7e026d30f707ecd1c9e3481b0ffde9f;p=open-adventure.git 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. --- diff --git a/main.c b/main.c index a57694e..a20d9dc 100644 --- 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)) {