Another rollup patch.
[super-star-trek.git] / src / setup.c
index 8bbafbc31e539f43fd0b7927979a31af22f303e7..aef792a38cfa9f07b5581940e367929327c61c52 100644 (file)
@@ -212,7 +212,7 @@ void setup(bool needprompt)
     for (i=0; i < NDEVICES; i++) 
        game.damage[i] = 0.0;
     // Set up assorted game parameters
-    game.battle.x = game.battle.y = 0;
+    invalidate(game.battle);
     game.state.date = game.indate = 100.0*(int)(31.0*Rand()+20.0);
     game.nkinks = game.nhelp = game.casual = game.abandoned = 0;
     game.iscate = game.resting = game.imine = game.icrystl = game.icraft = false;
@@ -324,7 +324,8 @@ void setup(bool needprompt)
                   game.state.galaxy[w.x][w.y].klingons > 8);
            // check for duplicate
            for (j = 1; j < i; j++)
-               if (game.state.kcmdr[j].x==w.x && game.state.kcmdr[j].y==w.y) break;
+               if (same(game.state.kcmdr[j], w))
+                   break;
        } while (j < i);
        game.state.galaxy[w.x][w.y].klingons++;
        game.state.kcmdr[i] = w;
@@ -336,12 +337,12 @@ void setup(bool needprompt)
        game.state.plnets[i].w = w;
        if (i < NINHAB) {
            game.state.plnets[i].pclass = M;    // All inhabited planets are class M
-           game.state.plnets[i].crystals = 0;
+           game.state.plnets[i].crystals = absent;
            game.state.plnets[i].known = known;
            game.state.plnets[i].inhabited = i;
        } else {
            game.state.plnets[i].pclass = Rand()*3.0; // Planet class M N or O
-           game.state.plnets[i].crystals = 1.5*Rand();         // 1 in 3 chance of crystals
+           game.state.plnets[i].crystals = Rand()*1.5;         // 1 in 3 chance of crystals
            game.state.plnets[i].known = unknown;
            game.state.plnets[i].inhabited = UNINHABITED;
        }
@@ -365,7 +366,7 @@ void setup(bool needprompt)
        thing = randplace(GALSIZE);
     }
     else
-       thing.x = thing.y = 0;
+       invalidate(thing);
 
     skip(2);
     game.state.snap = false;
@@ -379,13 +380,13 @@ void setup(bool needprompt)
              INKLINGTOT);
        prout(_("You have an initial allotment of %d stardates to complete"), (int)game.intime);
        prout(_("your mission.  As you proceed you may be given more time."));
-       prout("");
+       skip(1);
        prout(_("You will have %d supporting starbases."), game.inbase);
        proutn(_("Starbase locations-  "));
     }
     else {
        prout(_("Stardate %d."), (int)game.state.date);
-       prout("");
+       skip(1);
        prout(_("%d Klingons."), INKLINGTOT);
        prout(_("An unknown number of Romulans."));
        if (game.state.nscrem) prout(_("And one (GULP) Super-Commander."));
@@ -561,10 +562,10 @@ void newqad(bool shutup)
     struct quadrant *q;
 
     game.justin = true;
-    game.base.x = game.base.y = 0;
+    invalidate(game.base);
     game.klhere = 0;
     game.comhere = false;
-    game.plnet.x = game.plnet.y = 0;
+    invalidate(game.plnet);
     game.ishere = false;
     game.irhere = 0;
     game.iplnet = 0;
@@ -757,13 +758,13 @@ void sortkl(void)
 void setpassword(void)
 /* set the self-destruct password */
 {
-    if (!(game.options & OPTION_CURSES)) {
+    if (game.options & OPTION_PLAIN) {
        while (TRUE) {
+           chew();
+           proutn(_("Please type in a secret password- "));
            scan();
            strcpy(game.passwd, citem);
-           chew();
            if (*game.passwd != 0) break;
-           proutn(_("Please type in a secret password-"));
        }
     } else {
        int i;