Add test for urn actions.
[open-adventure.git] / main.c
diff --git a/main.c b/main.c
index 6ac17ce76b313889a1034a492b57b405f41e5034..5a3f2002683de89e3c78aad525adb756b0a447a0 100644 (file)
--- a/main.c
+++ b/main.c
@@ -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;
@@ -275,7 +264,7 @@ bool spotted_by_pirate(int i)
     /*  The pirate's spotted him.  He leaves him alone once we've
      *  found chest.  K counts if a treasure is here.  If not, and
      *  tally=1 for an unseen chest, let the pirate be spotted.
-     *  Note that game.place(CHEST)=0 might mean that he's thrown
+     *  Note that game.place[CHEST]=0 might mean that he's thrown
      *  it to the troll, but in that case he's seen the chest
      *  (game.prop=0). */
     if (game.loc == game.chloc || game.prop[CHEST] >= 0)
@@ -284,9 +273,7 @@ bool spotted_by_pirate(int i)
     for (int j=MINTRS; j<=MAXTRS; j++) {
        /*  Pirate won't take pyramid from plover room or dark
         *  room (too easy!). */
-       if (j == PYRAM && (game.loc == PLAC[PYRAM] || game.loc == PLAC[EMRALD])) {
-           if (HERE(j))
-               k=1;
+       if (j==PYRAM && (game.loc==PLAC[PYRAM] || game.loc==PLAC[EMRALD])) {
            return true;
        }
        if (TOTING(j)) {
@@ -308,11 +295,7 @@ 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;
@@ -918,7 +901,7 @@ static void listobjects(void)
 static bool do_command(FILE *cmdin)
 /* Get and execute a command */ 
 {
-    long KQ, VERB, KK, V1, V2;
+    long KQ, VERB, V1, V2;
     long i, k, KMOD;
     static long igo = 0;
     static long obj = 0;