Return if the arrow hit something after moving randomly
authorJulian Cowley <julesreid@lavanauts.org>
Mon, 7 Mar 2022 09:58:09 +0000 (23:58 -1000)
committerJulian Cowley <julesreid@lavanauts.org>
Mon, 7 Mar 2022 10:33:57 +0000 (00:33 -1000)
If the arrow hit something (you or the Wumpus) after it flew around
randomly because there was no tunnel, return from shoot().  This allows
the game to finish correctly.

wumpus.c

index f4dfe50fca6d90f60971f9e02c58fad8a001d066..2adc696d8179cc80d44252a4f5f6eba73d01e469 100644 (file)
--- a/wumpus.c
+++ b/wumpus.c
@@ -367,6 +367,8 @@ badrange:
 
        /* 835 GOTO 900                                                 */
        check_shot();
+       if (finished != NOT)
+           return;
 
        /* 840 NEXT K                                                   */
        nextpath: ;