Further code simplification.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 21 Jun 2017 00:44:21 +0000 (20:44 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 21 Jun 2017 00:44:21 +0000 (20:44 -0400)
actions.c

index 87301f72141a9aebd23360f9defe464163419d8f..0abccbca11f31920a2723d778d0ffcdb43c77408 100644 (file)
--- 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;
 }