X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=10fce6503f348e9673b9e70add4fa4eaf3d1e61c;hb=1a12a3acf226dd6e788f9a7d0ca5313449837f39;hp=75f646e4c0efa415d226c9f660d98a77b1eabb2d;hpb=169c683e458507d4419c909c82cc64eb3ae7c946;p=open-adventure.git diff --git a/main.c b/main.c index 75f646e..10fce65 100644 --- a/main.c +++ b/main.c @@ -8,7 +8,7 @@ * Now that the code has been restructured into something much closer * to idiomatic C, the following is more appropriate: * - * ESR apologizes for the remaing gotos (now confined to two functions + * ESR apologizes for the remaing gotos (now confined to one function * in this file - there used to be over 350 of them, *everywhere*), * and for the offensive globals. Applying the Structured Program * Theorem can be hard. @@ -122,20 +122,9 @@ int main(int argc, char *argv[]) set_seed(seedval); /* Initialize game variables */ - if (!game.setup) - initialise(); - - /* Unlike earlier versions, adventure is no longer restartable. (This - * lets us get away with modifying things such as OBJSND(BIRD) without - * having to be able to undo the changes later.) If a "used" copy is - * rerun, we come here and tell the player to run a fresh copy. */ - if (game.setup <= 0) { - RSPEAK(201); - exit(0); - } + initialise(); /* Start-up, dwarf stuff */ - game.setup= -1; game.zzword=RNDVOC(3,0); game.novice=YES(stdin, 65,1,0); game.newloc=1; @@ -146,7 +135,7 @@ int main(int argc, char *argv[]) if (logfp) fprintf(logfp, "seed %ld\n", seedval); - /* interpret commands ubtil EOF or interrupt */ + /* interpret commands until EOF or interrupt */ for (;;) { if (!do_command(stdin)) break; @@ -308,11 +297,8 @@ bool spotted_by_pirate(int i) game.dloc[PIRATE]=game.chloc; game.odloc[PIRATE]=game.chloc; game.dseen[PIRATE]=false; - /* C doesn't have what the Structured rogramming - * Theorem says we need here - multi-level loop - * breakout. We simulate with a goto. Irreducible, alas. - */ - return true; //goto jumpout; + + return true; } if (HERE(j)) k=1;