Abolish 2011 return from actions. A step towards localizing SPK.
[open-adventure.git] / main.c
diff --git a/main.c b/main.c
index 3c10dad85d60861d1df372100b7df477c884cc2c..4e1566dec7ed834b0f5931c92f15908e3ff6a49f 100644 (file)
--- a/main.c
+++ b/main.c
@@ -581,34 +581,33 @@ static bool playermove(FILE *cmdin, token_t verb)
     }
     LL=LL/1000;
 
-L11:
-    game.newloc=LL/1000;
-    K=MOD(game.newloc,100);
-    if (game.newloc <= 300) {
-       if (game.newloc <= 100)
-           goto L14;
-       if (TOTING(K) || (game.newloc > 200 && AT(K)))
-           goto L16;
-       goto L12;
+    for (;;) {
+       game.newloc=LL/1000;
+       K=MOD(game.newloc,100);
+       if (game.newloc <= 300) {
+           if (game.newloc <= 100) {
+               if (game.newloc == 0 || PCT(game.newloc))
+                   break;
+               /* else fall through */
+           } if (TOTING(K) || (game.newloc > 200 && AT(K)))
+                 break;
+           /* else fall through */
+       }
+       else if (game.prop[K] != game.newloc/100-3)
+           break;
+    L12:
+       do {
+           if (TRAVEL[KK] < 0)BUG(25);
+           ++KK;
+           game.newloc=labs(TRAVEL[KK])/1000;
+       } while
+           (game.newloc == LL);
+       LL=game.newloc;
     }
-    if (game.prop[K] != game.newloc/100-3)
-       goto L16;
-L12:
-    do {
-       if (TRAVEL[KK] < 0)BUG(25);
-       ++KK;
-       game.newloc=labs(TRAVEL[KK])/1000;
-    } while
-        (game.newloc == LL);
-    LL=game.newloc;
-    goto L11;
 
-L14:
-    if (game.newloc != 0 && !PCT(game.newloc))
-       goto L12;
-L16:
     game.newloc=MOD(LL,1000);
-    if (game.newloc <= 300) return true;
+    if (game.newloc <= 300)
+       return true;
     if (game.newloc <= 500) {
        game.newloc=game.newloc-300;
        switch (game.newloc)
@@ -713,7 +712,7 @@ L2000:      if (game.loc == 0)
        KK=STEXT[game.loc];
        if (MOD(game.abbrev[game.loc],game.abbnum) == 0 || KK == 0)
            KK=LTEXT[game.loc];
-       if (!FORCED(game.loc) && DARK(0)) {
+       if (!FORCED(game.loc) && DARK(game.loc)) {
            /*  The easiest way to get killed is to fall into a pit in
             *  pitch darkness. */
            if (game.wzdark && PCT(35)) {
@@ -740,7 +739,7 @@ L2000:      if (game.loc == 0)
         *  bear).  These hacks are because game.prop=0 is needed to
         *  get full score. */
 
-       if (DARK(0)) goto L2012;
+       if (DARK(game.loc)) goto L2012;
        ++game.abbrev[game.loc];
        i=game.atloc[game.loc];
 L2004: if (i == 0) goto L2012;
@@ -770,9 +769,7 @@ L2008:      i=game.link[i];
         goto L2004;
 
 L2009: K=54;
-L2010: SPK=K;
-L2011: RSPEAK(SPK);
-
+L2010: RSPEAK(K);
 L2012: VERB=0;
        game.oldobj=obj;
        obj=0;
@@ -806,7 +803,7 @@ L2603:      if (game.closed) {
                    game.prop[i] = -1-game.prop[i];
            }
        }
-       game.wzdark=DARK(0);
+       game.wzdark=DARK(game.loc);
        if (game.knfloc > 0 && game.knfloc != game.loc)
            game.knfloc=0;
 
@@ -1034,7 +1031,6 @@ Laction:
           case 2000: goto L2000;
           case 2009: goto L2009;
           case 2010: goto L2010;
-          case 2011: goto L2011;
           case 2012: goto L2012;
           case 2600: goto L2600;
           case 2607: goto L2607;