From: Eric S. Raymond Date: Mon, 7 Feb 2005 19:10:42 +0000 (+0000) Subject: Cleanup up after previous change. X-Git-Tag: 2.0~333 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=8bd7aca563c3a40239992666394fe8ff3f2fd5e3;p=super-star-trek.git Cleanup up after previous change. --- diff --git a/ai.c b/ai.c index fd9cf8c..d96f747 100644 --- a/ai.c +++ b/ai.c @@ -370,8 +370,8 @@ void scom(int *ipage) { int i, i2, j, ideltax, ideltay, ibqx, ibqy, sx, sy, ifindit, iwhichb; int iqx, iqy; - int basetbl[BASEMAX]; - double bdist[BASEMAX]; + int basetbl[BASEMAX+1]; + double bdist[BASEMAX+1]; int flag; #ifdef DEBUG if (idebug) prout("SCOM"); diff --git a/setup.c b/setup.c index f50f7c4..fb03bde 100644 --- a/setup.c +++ b/setup.c @@ -261,7 +261,7 @@ void setup(int needprompt) for (j = i-1; j > 0; j--) { /* Improved placement algorithm to spread out bases */ double distq = square(ix-game.state.baseqx[j]) + square(iy-game.state.baseqy[j]); - if (distq < 6.0*(BASEMAX-inbase) && Rand() < 0.75) { + if (distq < 6.0*(BASEMAX+1-inbase) && Rand() < 0.75) { contflag = TRUE; #ifdef DEBUG proutn("DEBUG: Abandoning base #%d at %d-%d\n", i, ix, iy); @@ -269,7 +269,7 @@ void setup(int needprompt) break; } #ifdef DEBUG - else if (distq < 6.0 * (BASEMAX-inbase)) { + else if (distq < 6.0 * (BASEMAX+1-inbase)) { proutn("DEBUG: saving base #%d, close to #%d\n", i, j); } #endif @@ -469,7 +469,7 @@ int choose(int needprompt) // Use parameters to generate initial values of things damfac = 0.5 * skill; - game.state.rembase = 2.0 + Rand()*(MAXBASES-2.0); + game.state.rembase = 2.0 + Rand()*(BASEMAX-2.0); inbase = game.state.rembase; if (game.options & OPTION_PLANETS) inplan = (PLNETMAX/2) + (PLNETMAX/2+1)*Rand();