X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fsetup.c;h=c8112e0ff17a2beffdd71e61e83e7a06b9cb1469;hb=321425c10831f63599c41c31e9d42bc4ec8001d0;hp=1948b8a90305e452acd075035e80d20a4428f8cf;hpb=2e04509ec9be1e3ad2a1f8a7e84552d6896f89ab;p=super-star-trek.git diff --git a/src/setup.c b/src/setup.c index 1948b8a..c8112e0 100644 --- a/src/setup.c +++ b/src/setup.c @@ -192,7 +192,8 @@ void setup(bool needprompt) setup_names(); // Decide how many of everything - if (choose(needprompt)) return; // frozen game + if (choose(needprompt)) + return; // frozen game // Prepare the Enterprise game.alldone = game.gamewon = false; game.ship = IHE; @@ -222,9 +223,9 @@ void setup(bool needprompt) game.landed = false; game.alive = true; game.docfac = 0.25; - for_quadrants(i) - for_quadrants(j) { - struct quadrant *quad = &game.state.galaxy[i][j]; + for (i = 1; i <= GALSIZE; i++) + for (j = 1; j <= GALSIZE; j++) { + struct quadrant *quad = &game.state.galaxy[i][j]; quad->charted = 0; quad->planet = NOPLANET; quad->romulans = 0; @@ -255,8 +256,8 @@ void setup(bool needprompt) game.lastchart = FOREVER; // Put stars in the galaxy game.instar = 0; - for_quadrants(i) - for_quadrants(j) { + for (i = 1; i <= GALSIZE; i++) + for (j = 1; j <= GALSIZE; j++) { int k = Rand()*9.0 + 1.0; game.instar += k; game.state.galaxy[i][j].stars = k; @@ -427,7 +428,8 @@ bool choose(bool needprompt) if (needprompt) /* Can start with command line options */ proutn(_("Would you like a regular, tournament, or saved game? ")); scan(); - if (strlen(citem)==0) continue; // Try again + if (strlen(citem)==0) // Try again + continue; if (isit("tournament")) { while (scan() == IHEOL) { proutn(_("Type in tournament number-")); @@ -605,8 +607,8 @@ void newqad(bool shutup) game.ientesc = true; } // Clear quadrant - for_sectors(i) - for_sectors(j) + for (i = 1; i <= QUADSIZE; i++) + for (j = 1; j <= QUADSIZE; j++) game.quad[i][j] = IHDOT; q = &game.state.galaxy[game.quadrant.x][game.quadrant.y]; // cope with supernova @@ -625,7 +627,7 @@ void newqad(bool shutup) for (i = 1; i <= game.klhere; i++) w = newkling(i); // If we need a commander, promote a Klingon - for_commanders(i) + for (i = 1; i <= game.state.remcom; i++) if (same(game.state.kcmdr[i], game.quadrant)) break; @@ -729,7 +731,7 @@ void newqad(bool shutup) } } - sortkl(); + sortklings(); // Put in a few black holes for (i = 1; i <= 3; i++) @@ -749,7 +751,7 @@ void newqad(bool shutup) } } -void sortkl(void) +void sortklings(void) /* sort Klingons by distance from us */ { double t;