Continue with next room if the path for the arrow is found
authorJulian Cowley <julesreid@lavanauts.org>
Mon, 7 Mar 2022 09:41:17 +0000 (23:41 -1000)
committerJulian Cowley <julesreid@lavanauts.org>
Mon, 7 Mar 2022 10:33:51 +0000 (00:33 -1000)
If the room specified by the user for the path of the arrow is one
of the three connecting rooms, the path for the arrow is found.
Continue with the next room in the path and do not consider it not
able to go that way (no tunnel).

Without this, the arrow flies around randomly because it drops through
to the portion of the code that deals with the path not being found
(no tunnel).

wumpus.c

index b4d983c73a444ff1ac2572ae9d636ee62f1f2435..f4dfe50fca6d90f60971f9e02c58fad8a001d066 100644 (file)
--- a/wumpus.c
+++ b/wumpus.c
@@ -355,6 +355,7 @@ badrange:
                check_shot();
                if (finished != NOT)
                    return;
+               goto nextpath;
            }
 
            /* 820 NEXT K1                                              */
@@ -368,6 +369,7 @@ badrange:
        check_shot();
 
        /* 840 NEXT K                                                   */
+       nextpath: ;
     }
 
     if (finished == NOT)