From: Eric S. Raymond Date: Wed, 21 Jun 2017 00:44:21 +0000 (-0400) Subject: Further code simplification. X-Git-Tag: 1.1~183 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=e798355e8080388e0e82aa18c0749b350c51835c;p=open-adventure.git Further code simplification. --- diff --git a/actions.c b/actions.c index 87301f7..0abccbc 100644 --- a/actions.c +++ b/actions.c @@ -798,23 +798,19 @@ static int read(struct command_t command) if (HERE(i) && OBJTXT[i] != 0 && game.prop[i] >= 0) command.obj = command.obj * NOBJECTS + i; } - if (command.obj > NOBJECTS || command.obj == 0 || DARK(game.loc)) return GO_UNKNOWN; + if (command.obj > NOBJECTS || command.obj == 0 || DARK(game.loc)) + return GO_UNKNOWN; } if (DARK(game.loc)) { SETPRM(1, command.wd1, command.wd1x); RSPEAK(NO_SEE); - return GO_CLEAROBJ; - } - if (OBJTXT[command.obj] == 0 || game.prop[command.obj] < 0) { + } else if (OBJTXT[command.obj] == 0 || game.prop[command.obj] < 0) { RSPEAK(ACTSPK[command.verb]); - return GO_CLEAROBJ; - } - if (command.obj == OYSTER && !game.clshnt) { + } else if (command.obj == OYSTER && !game.clshnt) { game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]); - return GO_CLEAROBJ; - } - PSPEAK(command.obj, OBJTXT[command.obj] + game.prop[command.obj]); + } else + PSPEAK(command.obj, OBJTXT[command.obj] + game.prop[command.obj]); return GO_CLEAROBJ; }