Return if the arrow hit something after moving randomly
[wumpus.git] / wumpus.c
index 6068fd689d4af240b4035bdc8a2b0cdf6bc410dc..2adc696d8179cc80d44252a4f5f6eba73d01e469 100644 (file)
--- a/wumpus.c
+++ b/wumpus.c
@@ -25,6 +25,8 @@
  *
  * So, pretend for a little while that your workstation is an ASR-33 and
  * limber up your fingers for a trip to nostalgia-land...
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
  */
 
 #include <stdio.h>
@@ -353,6 +355,7 @@ badrange:
                check_shot();
                if (finished != NOT)
                    return;
+               goto nextpath;
            }
 
            /* 820 NEXT K1                                              */
@@ -364,8 +367,11 @@ badrange:
 
        /* 835 GOTO 900                                                 */
        check_shot();
+       if (finished != NOT)
+           return;
 
        /* 840 NEXT K                                                   */
+       nextpath: ;
     }
 
     if (finished == NOT)