One more goto gone.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 8 Jun 2017 12:26:10 +0000 (08:26 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 8 Jun 2017 12:26:10 +0000 (08:26 -0400)
main.c

diff --git a/main.c b/main.c
index b5979e6875f72cb908eccb305752f5d762648757..944a14d45157d06e7a69911dcc2458f001aed2d0 100644 (file)
--- a/main.c
+++ b/main.c
@@ -346,11 +346,15 @@ static bool dwarfmove(void)
                if(HERE(J))
                    K=1;
            }
+           /* Force chest placement before player finds last treasure */
            if(game.tally == 1 && K == 0 && game.place[CHEST] == 0 && HERE(LAMP) && game.prop[LAMP] == 1) {
                RSPEAK(186);
                MOVE(CHEST,game.chloc);
                MOVE(MESSAG,game.chloc2);
-               goto L6024;
+               game.dloc[PIRATE]=game.chloc;
+               game.odloc[PIRATE]=game.chloc;
+               game.dseen[PIRATE]=false;
+               continue;
            }
            if(game.odloc[PIRATE] != game.dloc[PIRATE] && PCT(20))
                RSPEAK(127);
@@ -372,7 +376,6 @@ static bool dwarfmove(void)
                        DROP(J,game.chloc);
                }
            }
-       L6024:
            game.dloc[PIRATE]=game.chloc;
            game.odloc[PIRATE]=game.chloc;
            game.dseen[PIRATE]=false;