Yet more origin-hiding.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 7 Feb 2005 16:17:08 +0000 (16:17 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 7 Feb 2005 16:17:08 +0000 (16:17 +0000)
ai.c
battle.c
events.c

diff --git a/ai.c b/ai.c
index 33e4873f52b10a2ec83ced9e0280389980108988..fd9cf8ceecedcc77db509c839758e6a6208b5128 100644 (file)
--- a/ai.c
+++ b/ai.c
@@ -185,10 +185,10 @@ static void movebaddy(int comx, int comy, int loccom, int ienm)
     nextx = comx;
     nexty = comy;
     /* main move loop */
-    for (ll = 1; ll <= nsteps; ll++) {
+    for (ll = 0; ll < nsteps; ll++) {
 #ifdef DEBUG
        if (idebug) {
-           prout("%d", ll);
+           prout("%d", ll+1);
        }
 #endif
        /* Check if preferred position available */
index 5e1c40481525229e4a5efdb7afe362301e8d8fdf..4b3cf904e9ec10738c9a76b6422e9be758c639cf 100644 (file)
--- a/battle.c
+++ b/battle.c
@@ -299,7 +299,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i
        case IHB: /* Hit a base */
            skip(1);
            prout("***STARBASE DESTROYED..");
-           for (ll=1; ll<=game.state.rembase; ll++) {
+           for_starbases(ll) {
                if (game.state.baseqx[ll]==quadx && game.state.baseqy[ll]==quady) {
                    game.state.baseqx[ll]=game.state.baseqx[game.state.rembase];
                    game.state.baseqy[ll]=game.state.baseqy[game.state.rembase];
index fc03bb0f48bbb3d0ff493d9c1f8794d19507a99e..d65b188bea58aad088c3b37cfbcf0f174cdd21cc 100644 (file)
--- a/events.c
+++ b/events.c
@@ -18,7 +18,7 @@ void events(void)
        line = FSPY;
        if (alldone) return;
        datemin = fintim;
-       for (l=1; l<=NEVENTS; l++)
+       for (l = 1; l <= NEVENTS; l++)
            if (game.future[l] < datemin) {
                line = l;
                datemin = game.future[l];