Compute the maximum number of bases from BASEMAX.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 7 Feb 2005 19:05:07 +0000 (19:05 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 7 Feb 2005 19:05:07 +0000 (19:05 +0000)
setup.c
sst.h

diff --git a/setup.c b/setup.c
index 17c14cf030e59b231e24d6f5e3e8911178650dd7..f50f7c41e02acd3333a257470da5cac1e498aace 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -469,7 +469,7 @@ int choose(int needprompt)
 
     // Use parameters to generate initial values of things
     damfac = 0.5 * skill;
-    game.state.rembase = 3.0*Rand()+2.0;
+    game.state.rembase = 2.0 + Rand()*(MAXBASES-2.0);
     inbase = game.state.rembase;
     if (game.options & OPTION_PLANETS)
        inplan = (PLNETMAX/2) + (PLNETMAX/2+1)*Rand();
diff --git a/sst.h b/sst.h
index c9154adf43ea09aa879611bc2ba754cdd6800fa5..74f8d6ab3d863bf73f45a49570fac71360a37067 100644 (file)
--- a/sst.h
+++ b/sst.h
@@ -18,7 +18,7 @@
 #define PLNETMAX (10)
 #define GALSIZE        (8)
 #define QUADSIZE (10)
-#define BASEMAX        (6)
+#define BASEMAX        (5)
 
 /*
  * These macros hide the difference between 0-origin and 1-origin addressing.
@@ -52,8 +52,8 @@ typedef struct {
        killk,                  // Klingons killed
        killc,                  // commanders killed
        cx[QUADSIZE+1],cy[QUADSIZE+1],  // Commander quadrant coordinates
-       baseqx[BASEMAX],                // Base quadrant X
-       baseqy[BASEMAX],                // Base quadrant Y
+       baseqx[BASEMAX+1],              // Base quadrant X
+       baseqy[BASEMAX+1],              // Base quadrant Y
        isx, isy,               // Coordinate of Super Commander
        nscrem,                 // remaining super commanders
        nromkl,                 // Romulans killed