Yet more goto eliminations.

This commit is contained in:
Eric S. Raymond 2017-06-11 06:58:45 -04:00
parent 9b9eab70d8
commit 925aeab51b

56
main.c
View file

@ -727,8 +727,9 @@ L2000: if (game.loc == 0)
if (TOTING(BEAR))RSPEAK(141); if (TOTING(BEAR))RSPEAK(141);
SPEAK(KK); SPEAK(KK);
K=1; K=1;
if (FORCED(game.loc)) if (FORCED(game.loc)) {
goto L8; goto L8;
}
if (game.loc == 33 && PCT(25) && !game.closng)RSPEAK(7); if (game.loc == 33 && PCT(25) && !game.closng)RSPEAK(7);
/* Print out descriptions of objects at this location. If /* Print out descriptions of objects at this location. If
@ -889,8 +890,7 @@ L2607: game.foobar=(game.foobar>0 ? -game.foobar : 0);
game.clock1= -1; game.clock1= -1;
game.closng=true; game.closng=true;
goto L19999; goto L19999;
} } else if (game.clock1 < 0)
if (game.clock1 < 0)
--game.clock2; --game.clock2;
if (game.clock2 == 0) { if (game.clock2 == 0) {
/* Once he's panicked, and clock2 has run out, we come here /* Once he's panicked, and clock2 has run out, we come here
@ -963,12 +963,13 @@ L2607: game.foobar=(game.foobar>0 ? -game.foobar : 0);
game.prop[LAMP]=0; game.prop[LAMP]=0;
if (HERE(LAMP))RSPEAK(184); if (HERE(LAMP))RSPEAK(184);
} else if (game.limit <= 30) { } else if (game.limit <= 30) {
if (game.lmwarn || !HERE(LAMP)) goto L19999; if (!game.lmwarn && HERE(LAMP)) {
game.lmwarn=true; game.lmwarn=true;
SPK=187; SPK=187;
if (game.place[BATTER] == 0)SPK=183; if (game.place[BATTER] == 0)SPK=183;
if (game.prop[BATTER] == 1)SPK=189; if (game.prop[BATTER] == 1)SPK=189;
RSPEAK(SPK); RSPEAK(SPK);
}
} }
L19999: K=43; L19999: K=43;
if (LIQLOC(game.loc) == WATER)K=70; if (LIQLOC(game.loc) == WATER)K=70;
@ -1039,34 +1040,27 @@ Laction:
case 2607: goto L2607; case 2607: goto L2607;
case 2630: goto L2630; case 2630: goto L2630;
case 2800: goto L2800; case 2800: goto L2800;
case 8000: goto L8000; case 8000:
case 18999: goto L18999; /* Random intransitive verbs come here. Clear obj just in case
case 19000: goto L19000; * (see attack()). */
SETPRM(1,WD1,WD1X);
RSPEAK(257);
obj=0;
goto L2600;
case 18999:
/* Oh dear, he's disturbed the dwarves. */
RSPEAK(SPK);
/* fall through */
case 19000:
RSPEAK(136);
score(0);
return true;
} }
BUG(99); BUG(99);
/* Random intransitive verbs come here. Clear obj just in case
* (see attack()). */
L8000: SETPRM(1,WD1,WD1X);
RSPEAK(257);
obj=0;
goto L2600;
/* Figure out the new location */ /* Figure out the new location */
L8: if (playermove(cmdin, VERB)) L8: if (playermove(cmdin, VERB))
return true; return true;
else else
goto L2000; goto L2000;
/* Cave closing and scoring */
/* Oh dear, he's disturbed the dwarves. */
L18999: RSPEAK(SPK);
L19000: RSPEAK(136);
score(0);
return true;
} }