From: Eric S. Raymond Date: Thu, 3 Aug 2017 18:22:38 +0000 (-0400) Subject: Simplify overcomplicated code. X-Git-Tag: 1.4~5 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=0468da2cdf37b2f424a68c859ac88c31d67534a2;p=open-adventure.git Simplify overcomplicated code. --- diff --git a/main.c b/main.c index 7437c81..a57694e 100644 --- a/main.c +++ b/main.c @@ -1121,17 +1121,16 @@ Lclearobj: command.word[0].id = ENTRANCE; } } - 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)) { command.word[1].id = POUR; command.word[1].type = ACTION; - strncpy(command.word[1].raw, "POUR", LINESIZE - 1); + strncpy(command.word[1].raw, "pour", LINESIZE - 1); } } if (command.word[0].id == CAGE && command.word[1].id == BIRD && HERE(CAGE) && HERE(BIRD)) { command.word[0].id = CARRY; command.word[0].type = ACTION; - strncpy(command.word[1].raw, "CATCH", LINESIZE - 1); } }