Heed other hazards when bumping the Wumpus
[wumpus.git] / wumpus.c
index 5d4efe41d5363215a90e420675258f270fbc0437..857bce2df15bfc267b90165cf3581be85931bf2b 100644 (file)
--- a/wumpus.c
+++ b/wumpus.c
@@ -521,8 +521,11 @@ goodmove:
        /* 1080 RETURN                                                  */
        (void) puts("... OOPS! BUMPED A WUMPUS!");
        move_wumpus();
+       if (finished < 0)
+           return;
+       /* Fall through since Wumpus could have been in a pit or bat room */
     }
-    else if (scratchloc == loc[PIT1] || scratchloc == loc[PIT2])
+    if (scratchloc == loc[PIT1] || scratchloc == loc[PIT2])
     {
        /* 1085 REM *** PIT ***                                         */
        /* 1090 IF L=L(3) THEN 1100                                     */
@@ -532,8 +535,9 @@ goodmove:
        /* 1110 RETURN                                                  */
        (void) puts("YYYYIIIIEEEE . . . FELL IN PIT");
        finished = LOSE;
+       return;
     }
-    else if (scratchloc == loc[BATS1] || scratchloc == loc[BATS2])
+    if (scratchloc == loc[BATS1] || scratchloc == loc[BATS2])
     {
        /* 1115 REM *** BATS ***                                        */
        /* 1120 IF L=L(5) THEN 1130                                     */