The quad global gets pulled into the frozen structure.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 31 Oct 2004 20:26:15 +0000 (20:26 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 31 Oct 2004 20:26:15 +0000 (20:26 +0000)
ai.c
battle.c
events.c
finish.c
moving.c
planets.c
reports.c
setup.c
sst.h

diff --git a/ai.c b/ai.c
index e34eabcfd58a0e6cb242f61fbae5ef7314deeade..6b173b5eb1ca3c8752010ba4ea1cefbf76f19398 100644 (file)
--- a/ai.c
+++ b/ai.c
@@ -187,7 +187,7 @@ static void movebaddy(int comx, int comy, int loccom, int ienm) {
        if (my != 0) my = my*motion < 0 ? -1 : 1;\r
        nextx = comx;\r
        nexty = comy;\r
-       quad[comx][comy] = IHDOT;\r
+       frozen.quad[comx][comy] = IHDOT;\r
        /* main move loop */\r
        for (ll = 1; ll <= nsteps; ll++) {\r
 #ifdef DEBUG\r
@@ -218,9 +218,9 @@ static void movebaddy(int comx, int comy, int loccom, int ienm) {
                                looky = nexty + krawly;\r
                                krawly = -krawly;\r
                        }\r
-                       else if (quad[lookx][looky] != IHDOT) {\r
+                       else if (frozen.quad[lookx][looky] != IHDOT) {\r
                                /* See if we should ram ship */\r
-                               if (quad[lookx][looky] == ship &&\r
+                               if (frozen.quad[lookx][looky] == ship &&\r
                                        (ienm == IHC || ienm == IHS)) {\r
                                        ram(1, ienm, comx, comy);\r
                                        return;\r
@@ -250,7 +250,7 @@ static void movebaddy(int comx, int comy, int loccom, int ienm) {
                else break; /* done early */\r
        }\r
        /* Put commander in place within same quadrant */\r
-       quad[nextx][nexty] = ienm;\r
+       frozen.quad[nextx][nexty] = ienm;\r
        if (nextx != comx || nexty != comy) {\r
                /* it moved */\r
                kx[loccom] = nextx;\r
@@ -280,7 +280,7 @@ void movcom(void) {
        if (comhere) for (i = 1; i <= nenhere; i++) {\r
                ix = kx[i];\r
                iy = ky[i];\r
-               if (quad[ix][iy] == IHC) {\r
+               if (frozen.quad[ix][iy] == IHC) {\r
                        movebaddy(ix, iy, i, IHC);\r
                        break;\r
                }\r
@@ -288,7 +288,7 @@ void movcom(void) {
        if (ishere) for (i = 1; i <= nenhere; i++) {\r
                ix = kx[i];\r
                iy = ky[i];\r
-               if (quad[ix][iy] == IHS) {\r
+               if (frozen.quad[ix][iy] == IHS) {\r
                        movebaddy(ix, iy, i, IHS);\r
                        break;\r
                }\r
@@ -299,8 +299,8 @@ void movcom(void) {
        if (skill > 3) for (i = 1; i <= nenhere; i++) {\r
                ix = kx[i];\r
                iy = ky[i];\r
-               if (quad[ix][iy] == IHK || quad[ix][iy] == IHR)\r
-                       movebaddy(ix, iy, i, quad[ix][iy]);\r
+               if (frozen.quad[ix][iy] == IHK || frozen.quad[ix][iy] == IHR)\r
+                       movebaddy(ix, iy, i, frozen.quad[ix][iy]);\r
        }\r
 \r
        sortkl();\r
@@ -331,8 +331,8 @@ static int checkdest(int iqx, int iqy, int flag, int *ipage) {
                ientesc=0;\r
                future[FSCDBAS]=1e30;\r
                for (i = 1; i <= nenhere; i++) \r
-                       if (quad[kx[i]][ky[i]] == IHS) break;\r
-               quad[kx[i]][ky[i]] = IHDOT;\r
+                       if (frozen.quad[kx[i]][ky[i]] == IHS) break;\r
+               frozen.quad[kx[i]][ky[i]] = IHDOT;\r
                kx[i] = kx[nenhere];\r
                ky[i] = ky[nenhere];\r
                kdist[i] = kdist[nenhere];\r
@@ -572,15 +572,15 @@ void movetho(void) {
        }\r
 \r
        /* Do nothing if we are blocked */\r
-       if (quad[idx][idy]!= IHDOT && quad[idx][idy]!= IHWEB) return;\r
-       quad[ithx][ithy] = IHWEB;\r
+       if (frozen.quad[idx][idy]!= IHDOT && frozen.quad[idx][idy]!= IHWEB) return;\r
+       frozen.quad[ithx][ithy] = IHWEB;\r
 \r
        if (ithx != idx) {\r
                /* move in x axis */\r
                im = fabs((double)idx - ithx)/((double)idx - ithx);\r
                while (ithx != idx) {\r
                        ithx += im;\r
-                       if (quad[ithx][ithy]==IHDOT) quad[ithx][ithy] = IHWEB;\r
+                       if (frozen.quad[ithx][ithy]==IHDOT) frozen.quad[ithx][ithy] = IHWEB;\r
                }\r
        }\r
        else if (ithy != idy) {\r
@@ -588,20 +588,20 @@ void movetho(void) {
                im = fabs((double)idy - ithy)/((double)idy - ithy);\r
                while (ithy != idy) {\r
                        ithy += im;\r
-                       if (quad[ithx][ithy]==IHDOT) quad[ithx][ithy] = IHWEB;\r
+                       if (frozen.quad[ithx][ithy]==IHDOT) frozen.quad[ithx][ithy] = IHWEB;\r
                }\r
        }\r
-       quad[ithx][ithy] = IHT;\r
+       frozen.quad[ithx][ithy] = IHT;\r
 \r
        /* check to see if all holes plugged */\r
        for (i = 1; i < 11; i++) {\r
-               if (quad[1][i]!=IHWEB && quad[1][i]!=IHT) return;\r
-               if (quad[10][i]!=IHWEB && quad[10][i]!=IHT) return;\r
-               if (quad[i][1]!=IHWEB && quad[i][1]!=IHT) return;\r
-               if (quad[i][10]!=IHWEB && quad[i][10]!=IHT) return;\r
+               if (frozen.quad[1][i]!=IHWEB && frozen.quad[1][i]!=IHT) return;\r
+               if (frozen.quad[10][i]!=IHWEB && frozen.quad[10][i]!=IHT) return;\r
+               if (frozen.quad[i][1]!=IHWEB && frozen.quad[i][1]!=IHT) return;\r
+               if (frozen.quad[i][10]!=IHWEB && frozen.quad[i][10]!=IHT) return;\r
        }\r
        /* All plugged up -- Tholian splits */\r
-       quad[ithx][ithy]=IHWEB;\r
+       frozen.quad[ithx][ithy]=IHWEB;\r
        dropin(IHBLANK, &dum, &my);\r
        crmena(1,IHT, 2, ithx, ithy);\r
        prout(" completes web.");\r
index 184bc7cf144ca1df8a5953a779c2da5842e446da..2633a32f97829a480004336f66671c2bde642efb 100644 (file)
--- a/battle.c
+++ b/battle.c
@@ -197,7 +197,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit) {
                proutn(" - ");\r
                cramf(y, 0, 1);\r
                proutn("   ");\r
-               iquad=quad[ix][iy];\r
+               iquad=frozen.quad[ix][iy];\r
                if (iquad==IHDOT) continue;\r
                /* hit something */\r
                skip(1);\r
@@ -223,11 +223,11 @@ void torpedo(double course, double r, int inx, int iny, double *hit) {
                                jx=ix+xx+0.5;\r
                                jy=iy+yy+0.5;\r
                                if (jx<1 || jx>10 || jy<1 ||jy > 10) return;\r
-                               if (quad[jx][jy]==IHBLANK) {\r
+                               if (frozen.quad[jx][jy]==IHBLANK) {\r
                                        finish(FHOLE);\r
                                        return;\r
                                }\r
-                               if (quad[jx][jy]!=IHDOT) {\r
+                               if (frozen.quad[jx][jy]!=IHDOT) {\r
                                        /* can't move into object */\r
                                        return;\r
                                }\r
@@ -274,12 +274,12 @@ void torpedo(double course, double r, int inx, int iny, double *hit) {
                                        prout(" damaged but not destroyed.");\r
                                        return;\r
                                }\r
-                               if (quad[jx][jy]==IHBLANK) {\r
+                               if (frozen.quad[jx][jy]==IHBLANK) {\r
                                        prout(" buffeted into black hole.");\r
                                        deadkl(ix, iy, iquad, jx, jy);\r
                                        return;\r
                                }\r
-                               if (quad[jx][jy]!=IHDOT) {\r
+                               if (frozen.quad[jx][jy]!=IHDOT) {\r
                                        /* can't move into object */\r
                                        prout(" damaged but not destroyed.");\r
                                        return;\r
@@ -299,7 +299,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit) {
                                                break;\r
                                        }\r
                                }\r
-                               quad[ix][iy]=IHDOT;\r
+                               frozen.quad[ix][iy]=IHDOT;\r
                                state.rembase--;\r
                                basex=basey=0;\r
                                state.galaxy[quadx][quady] -= 10;\r
@@ -314,7 +314,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit) {
                                state.plnets[iplnet] = nulplanet;\r
                                iplnet = 0;\r
                                plnetx = plnety = 0;\r
-                               quad[ix][iy] = IHDOT;\r
+                               frozen.quad[ix][iy] = IHDOT;\r
                                if (landed==1) {\r
                                        /* captain parishes on planet */\r
                                        finish(FDPLANET);\r
@@ -337,7 +337,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit) {
                                proutn("Mr. Spock-");\r
                                prouts("  \"Facinating!\"");\r
                                skip(1);\r
-                               quad[ix][iy] = IHDOT;\r
+                               frozen.quad[ix][iy] = IHDOT;\r
                                return;\r
                        case IHBLANK: /* Black hole */\r
                                skip(1);\r
@@ -357,7 +357,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit) {
                                h1 = fabs(h1);\r
                                if (h1 >= 600) {\r
                                        prout(" destroyed.");\r
-                                       quad[ix][iy] = IHDOT;\r
+                                       frozen.quad[ix][iy] = IHDOT;\r
                                        ithere = 0;\r
                                        ithx = ithy = 0;\r
                                        return;\r
@@ -367,7 +367,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit) {
                                        return;\r
                                }\r
                                prout(" disappears.");\r
-                               quad[ix][iy] = IHWEB;\r
+                               frozen.quad[ix][iy] = IHWEB;\r
                                ithere = ithx = ithy = 0;\r
                                {\r
                                        int dum, my;\r
@@ -385,8 +385,8 @@ void torpedo(double course, double r, int inx, int iny, double *hit) {
                break;\r
        }\r
        if (shoved) {\r
-               quad[jx][jy]=iquad;\r
-               quad[ix][iy]=IHDOT;\r
+               frozen.quad[jx][jy]=iquad;\r
+               frozen.quad[ix][iy]=IHDOT;\r
                proutn(" displaced by blast to");\r
                cramlc(2, jx, jy);\r
                skip(1);\r
@@ -469,7 +469,7 @@ void attack(int k) {
                if (kpower[l] < 500) r *= 0.25; \r
                jx = kx[l];\r
                jy = ky[l];\r
-               iquad = quad[jx][jy];\r
+               iquad = frozen.quad[jx][jy];\r
                itflag = (iquad == IHK && r > 0.0005) || k == 0 ||\r
                        (iquad==IHC && r > 0.015) ||\r
                        (iquad==IHR && r > 0.3) ||\r
@@ -632,7 +632,7 @@ void deadkl(int ix, int iy, int type, int ixx, int iyy) {
 \r
        /* For each kind of enemy, finish message to player */\r
        prout(" destroyestate.");\r
-       quad[ix][iy] = IHDOT;\r
+       frozen.quad[ix][iy] = IHDOT;\r
        if (state.remkl==0) return;\r
 \r
        state.remtime = state.remres/(state.remkl + 4*state.remcom);\r
@@ -1059,7 +1059,7 @@ void phasers(void) {
                        rpow = 0.0;\r
                        for (k = 1; k <= nenhere;) {\r
                                int ii = kx[k], jj = ky[k];\r
-                               int ienm = quad[ii][jj];\r
+                               int ienm = frozen.quad[ii][jj];\r
                                if (msgflag) {\r
                                        proutn("Energy available= ");\r
                                        cramf(energy-.006-(ifast?200:0), 0, 2);\r
@@ -1190,7 +1190,7 @@ void hittem(double *hits) {
                }\r
                else\r
                        proutn("Very small hit on ");\r
-               ienm = quad[ii][jj];\r
+               ienm = frozen.quad[ii][jj];\r
                crmena(0,ienm,2,ii,jj);\r
                skip(1);\r
                if (kpow == 0) {\r
index 098c4a213707e731072367debd1e71ba8519f738..b94c05a76913ebaaf435b569bb68dc618d4cbff9 100644 (file)
--- a/events.c
+++ b/events.c
@@ -260,7 +260,7 @@ void events(void) {
                                /* Handle case where base is in same quadrant as starship */\r
                                if (batx==quadx && baty==quady) {\r
                                        if (starch[batx][baty] > 999) starch[batx][baty] -= 10;\r
-                                       quad[basex][basey]= IHDOT;\r
+                                       frozen.quad[basex][basey]= IHDOT;\r
                                        basex=basey=0;\r
                                        newcnd();\r
                                        skip(1);\r
@@ -424,7 +424,7 @@ void nova(int ix, int iy) {
        }\r
 \r
        /* handle initial nova */\r
-       quad[ix][iy] = IHDOT;\r
+       frozen.quad[ix][iy] = IHDOT;\r
        crmena(1, IHSTAR, 2, ix, iy);\r
        prout(" novas.");\r
        state.galaxy[quadx][quady] -= 1;\r
@@ -444,7 +444,7 @@ void nova(int ix, int iy) {
                                ii = hits[mm][1]+nn-2;\r
                                jj = hits[mm][2]+j-2;\r
                                if (ii < 1 || ii > 10 || jj < 1 || jj > 10) continue;\r
-                               iquad = quad[ii][jj];\r
+                               iquad = frozen.quad[ii][jj];\r
                                switch (iquad) {\r
 //                                     case IHDOT:     /* Empty space ends reaction\r
 //                                     case IHQUEST:\r
@@ -466,7 +466,7 @@ void nova(int ix, int iy) {
                                                state.starkl++;\r
                                                crmena(1, IHSTAR, 2, ii, jj);\r
                                                prout(" novas.");\r
-                                               quad[ii][jj] = IHDOT;\r
+                                               frozen.quad[ii][jj] = IHDOT;\r
                                                break;\r
                                        case IHP: /* Destroy planet */\r
                                                state.newstuf[quadx][quady] -= 1;\r
@@ -479,7 +479,7 @@ void nova(int ix, int iy) {
                                                        finish(FPNOVA);\r
                                                        return;\r
                                                }\r
-                                               quad[ii][jj] = IHDOT;\r
+                                               frozen.quad[ii][jj] = IHDOT;\r
                                                break;\r
                                        case IHB: /* Destroy base */\r
                                                state.galaxy[quadx][quady] -= 10;\r
@@ -493,7 +493,7 @@ void nova(int ix, int iy) {
                                                newcnd();\r
                                                crmena(1, IHB, 2, ii, jj);\r
                                                prout(" destroyed.");\r
-                                               quad[ii][jj] = IHDOT;\r
+                                               frozen.quad[ii][jj] = IHDOT;\r
                                                break;\r
                                        case IHE: /* Buffet ship */\r
                                        case IHF:\r
@@ -541,7 +541,7 @@ void nova(int ix, int iy) {
                                                        skip(1);\r
                                                        break;\r
                                                }\r
-                                               iquad1 = quad[newcx][newcy];\r
+                                               iquad1 = frozen.quad[newcx][newcy];\r
                                                if (iquad1 == IHBLANK) {\r
                                                        proutn(", blasted into ");\r
                                                        crmena(0, IHBLANK, 2, newcx, newcy);\r
@@ -556,8 +556,8 @@ void nova(int ix, int iy) {
                                                }\r
                                                proutn(", buffeted to");\r
                                                cramlc(2, newcx, newcy);\r
-                                               quad[ii][jj] = IHDOT;\r
-                                               quad[newcx][newcy] = iquad;\r
+                                               frozen.quad[ii][jj] = IHDOT;\r
+                                               frozen.quad[newcx][newcy] = iquad;\r
                                                kx[ll] = newcx;\r
                                                ky[ll] = newcy;\r
                                                kavgd[ll] = sqrt(square(sectx-newcx)+square(secty-newcy));\r
@@ -651,7 +651,7 @@ void snova(int insx, int insy) {
                        num = Rand()* (state.galaxy[nqx][nqy]%10) + 1;\r
                        for (nsx=1; nsx < 10; nsx++) {\r
                                for (nsy=1; nsy < 10; nsy++) {\r
-                                       if (quad[nsx][nsy]==IHSTAR) {\r
+                                       if (frozen.quad[nsx][nsy]==IHSTAR) {\r
                                                num--;\r
                                                if (num==0) break;\r
                                        }\r
index c9d6aa42a906fda31e5966e5150362b8e703e11e..e396759591e6058069467f9b13fbff7fdc5e53bd 100644 (file)
--- a/finish.c
+++ b/finish.c
@@ -56,7 +56,7 @@ void kaboom(void) {
                int l=1;\r
                while (l <= nenhere) {\r
                        if (kpower[l]*kdist[l] <= whammo) \r
-                               deadkl(kx[l],ky[l], quad[kx[l]][ky[l]], kx[l], ky[l]);\r
+                               deadkl(kx[l],ky[l], frozen.quad[kx[l]][ky[l]], kx[l], ky[l]);\r
                        l++;\r
                }\r
        }\r
index 9eb70960c277f72971d3d356e0fec83af5253cf4..24c9643e6187cc3e054a4b94ece8d303443b1ff3 100644 (file)
--- a/moving.c
+++ b/moving.c
@@ -31,7 +31,7 @@ void move(void) {
                Time = future[FTBEAM] - state.date + 1e-5;\r
        }\r
        /* Move within the quadrant */\r
-       quad[sectx][secty] = IHDOT;\r
+       frozen.quad[sectx][secty] = IHDOT;\r
        x = sectx;\r
        y = secty;\r
        n = 10.0*dist*bigger+0.5;\r
@@ -101,11 +101,11 @@ void move(void) {
                                proutn("\nEntering");\r
                                cramlc(1, quadx, quady);\r
                                skip(1);\r
-                               quad[sectx][secty] = ship;\r
+                               frozen.quad[sectx][secty] = ship;\r
                                newqad(0);\r
                                return;\r
                        }\r
-                       iquad = quad[ix][iy];\r
+                       iquad = frozen.quad[ix][iy];\r
                        if (iquad != IHDOT) {\r
                                /* object encountered in flight path */\r
                                stopegy = 50.0*dist/Time;\r
@@ -170,7 +170,7 @@ void move(void) {
        finaly = secty;\r
 label100:\r
        /* No quadrant change -- compute new avg enemy distances */\r
-       quad[sectx][secty] = ship;\r
+       frozen.quad[sectx][secty] = ship;\r
        if (nenhere) {\r
                for (l = 1; l <= nenhere; l++) {\r
                        finald = sqrt((ix-kx[l])*(double)(ix-kx[l]) +\r
@@ -567,7 +567,7 @@ void warp(int i) {
                                y += deltay;\r
                                iy = y +0.5;\r
                                if (iy < 1 || iy > 10) break;\r
-                               if (quad[ix][iy] != IHDOT) {\r
+                               if (frozen.quad[ix][iy] != IHDOT) {\r
                                        blooey = 0;\r
                                        twarp = 0;\r
                                }\r
@@ -921,7 +921,7 @@ void help(void) {
                newqad(1);\r
        }\r
        /* dematerialize starship */\r
-       quad[sectx][secty]=IHDOT;\r
+       frozen.quad[sectx][secty]=IHDOT;\r
        proutn("Starbase in");\r
        cramlc(1, quadx, quady);\r
        proutn(" responds--");\r
@@ -949,12 +949,12 @@ void help(void) {
        for (l = 1; l <= 5; l++) {\r
                ix = basex+3.0*Rand()-1;\r
                iy = basey+3.0*Rand()-1;\r
-               if (ix>=1 && ix<=10 && iy>=1 && iy<=10 && quad[ix][iy]==IHDOT) {\r
+               if (ix>=1 && ix<=10 && iy>=1 && iy<=10 && frozen.quad[ix][iy]==IHDOT) {\r
                        /* found one -- finish up */\r
                        prout("succeeds.");\r
                        sectx=ix;\r
                        secty=iy;\r
-                       quad[ix][iy]=ship;\r
+                       frozen.quad[ix][iy]=ship;\r
                        dock();\r
                        skip(1);\r
                        prout("Lt. Uhura-  \"Captain, we made it!\"");\r
index fefa8a4a1b95e72aa99420464ff8413eddbb4335..133b0daca74fa92ce2a696ab4bf4942b6b0b71ce 100644 (file)
--- a/planets.c
+++ b/planets.c
@@ -437,7 +437,7 @@ void deathray(void) {
                prouts("Sulu- \"Captain!  It's working!\"");\r
                skip(2);\r
                while (nenhere > 0)\r
-                       deadkl(kx[1],ky[1],quad[kx[1]][ky[1]],kx[1],ky[1]);\r
+                       deadkl(kx[1],ky[1],frozen.quad[kx[1]][ky[1]],kx[1],ky[1]);\r
                prout("Ensign Chekov-  \"Congratulations, Captain!\"");\r
                if (state.remkl == 0) finish(FWON);\r
                prout("Spock-  \"Captain, I believe the `Experimental Death Ray'");\r
@@ -488,7 +488,7 @@ void deathray(void) {
                prout(" Mr. Sulu.");\r
                for (i=1; i<=10; i++)\r
                        for (j=1; j<=10; j++)\r
-                               if (quad[i][j] == IHDOT) quad[i][j] = IHQUEST;\r
+                               if (frozen.quad[i][j] == IHDOT) frozen.quad[i][j] = IHQUEST;\r
                prout("  Captain, our quadrant is now infested with");\r
                prouts(" - - - - - -  *THINGS*.");\r
                skip(1);\r
index afed60a5aaaea88811f3dfbd2c5477a88dff3bf1..6ce31c478cc8e043a70288900d5f09f2265b066b 100644 (file)
--- a/reports.c
+++ b/reports.c
@@ -270,7 +270,7 @@ void srscan(int l) {
                        printf("%2d  ", i);\r
                        for (j = 1; j <= 10; j++) {\r
                                if (goodScan || (abs(i-sectx)<= 1 && abs(j-secty) <= 1))\r
-                                       printf("%c ",quad[i][j]);\r
+                                       printf("%c ",frozen.quad[i][j]);\r
                                else\r
                                        printf("- ");\r
                        }\r
diff --git a/setup.c b/setup.c
index 6484243bb9879f24d3faac343f9eb8c3124814b6..5c3174878314156308b9fc8e53236dbca1836fac 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -38,7 +38,6 @@ void freeze(int boss) {
        }\r
        fwrite(&state, sizeof(state), 1, fp);\r
        fwrite(&snapsht, sizeof(snapsht), 1, fp);\r
-       fwrite(quad, sizeof(quad), 1, fp);\r
        fwrite(kx, sizeof(kx), 1, fp);\r
        fwrite(ky, sizeof(ky), 1, fp);\r
        fwrite(starch, sizeof(starch), 1, fp);\r
@@ -82,7 +81,6 @@ void thaw(void) {
        }\r
        fread(&state, sizeof(state), 1, fp);\r
        fread(&snapsht, sizeof(snapsht), 1, fp);\r
-       fread(quad, sizeof(quad), 1, fp);\r
        fread(kx, sizeof(kx), 1, fp);\r
        fread(ky, sizeof(ky), 1, fp);\r
        fread(starch, sizeof(starch), 1, fp);\r
@@ -161,13 +159,13 @@ void abandn(void) {
                }\r
                for (;;) {\r
                        /* position next to base by trial and error */\r
-                       quad[sectx][secty] = IHDOT;\r
+                       frozen.quad[sectx][secty] = IHDOT;\r
                        for (l = 1; l <= 10; l++) {\r
                                sectx = 3.0*Rand() - 1.0 + basex;\r
                                secty = 3.0*Rand() - 1.0 + basey;\r
                                if (sectx >= 1 && sectx <= 10 &&\r
                                        secty >= 1 && secty <= 10 &&\r
-                                       quad[sectx][secty] == IHDOT) break;\r
+                                       frozen.quad[sectx][secty] == IHDOT) break;\r
                        }\r
                        if (l < 11) break; /* found a spot */\r
                        sectx=5;\r
@@ -176,7 +174,7 @@ void abandn(void) {
                }\r
        }\r
        /* Get new commission */\r
-       quad[sectx][secty] = ship = IHF;\r
+       frozen.quad[sectx][secty] = ship = IHF;\r
        prout("Starfleet puts you in command of another ship,");\r
        prout("the Faerie Queene, which is antiquated but,");\r
        prout("still useable.");\r
@@ -498,8 +496,8 @@ int choose(void) {
 \r
 void dropin(int iquad, int *ix, int *iy) {\r
        do iran10(ix, iy);\r
-       while (quad[*ix][*iy] != IHDOT);\r
-       quad[*ix][*iy] = iquad;\r
+       while (frozen.quad[*ix][*iy] != IHDOT);\r
+       frozen.quad[*ix][*iy] = iquad;\r
 }\r
 \r
 void newcnd(void) {\r
@@ -538,7 +536,7 @@ void newqad(int shutup) {
        }\r
        // Clear quadrant\r
        for (i=1; i <= 10; i++)\r
-               for (j=1; j <= 10; j++) quad[i][j] = IHDOT;\r
+               for (j=1; j <= 10; j++) frozen.quad[i][j] = IHDOT;\r
        // cope with supernova\r
        if (quadnum > 999) {\r
                return;\r
@@ -549,7 +547,7 @@ void newqad(int shutup) {
        nenhere = klhere + irhere;\r
 \r
        // Position Starship\r
-       quad[sectx][secty] = ship;\r
+       frozen.quad[sectx][secty] = ship;\r
 \r
        // Decide if quadrant needs a Tholian\r
        if ((skill < 3 && Rand() <= 0.02) ||   /* Lighten up if skill is low */\r
@@ -562,14 +560,14 @@ void newqad(int shutup) {
                do {\r
                        ithx = Rand() > 0.5 ? 10 : 1;\r
                        ithy = Rand() > 0.5 ? 10 : 1;\r
-               } while (quad[ithx][ithy] != IHDOT);\r
-               quad[ithx][ithy] = IHT;\r
+               } while (frozen.quad[ithx][ithy] != IHDOT);\r
+               frozen.quad[ithx][ithy] = IHT;\r
                ithere = 1;\r
                /* Reserve unocupied corners */\r
-               if (quad[1][1]==IHDOT) quad[1][1] = 'X';\r
-               if (quad[1][10]==IHDOT) quad[1][10] = 'X';\r
-               if (quad[10][1]==IHDOT) quad[10][1] = 'X';\r
-               if (quad[10][10]==IHDOT) quad[10][10] = 'X';\r
+               if (frozen.quad[1][1]==IHDOT) frozen.quad[1][1] = 'X';\r
+               if (frozen.quad[1][10]==IHDOT) frozen.quad[1][10] = 'X';\r
+               if (frozen.quad[10][1]==IHDOT) frozen.quad[10][1] = 'X';\r
+               if (frozen.quad[10][10]==IHDOT) frozen.quad[10][10] = 'X';\r
        }\r
 \r
        if (quadnum >= 100) {\r
@@ -587,14 +585,14 @@ void newqad(int shutup) {
                        if (state.cx[i]==quadx && state.cy[i]==quady) break;\r
                        \r
                if (i <= state.remcom) {\r
-                       quad[ix][iy] = IHC;\r
+                       frozen.quad[ix][iy] = IHC;\r
                        kpower[klhere] = 950.0+400.0*Rand()+50.0*skill;\r
                        comhere = 1;\r
                }\r
 \r
                // If we need a super-commander, promote a Klingon\r
                if (quadx == state.isx && quady == state.isy) {\r
-                       quad[kx[1]][ky[1]] = IHS;\r
+                       frozen.quad[kx[1]][ky[1]] = IHS;\r
                        kpower[1] = 1175.0 + 400.0*Rand() + 125.0*skill;\r
                        iscate = 1;\r
                        ishere = 1;\r
@@ -661,10 +659,10 @@ void newqad(int shutup) {
 \r
        // Take out X's in corners if Tholian present\r
        if (ithere) {\r
-               if (quad[1][1]=='X') quad[1][1] = IHDOT;\r
-               if (quad[1][10]=='X') quad[1][10] = IHDOT;\r
-               if (quad[10][1]=='X') quad[10][1] = IHDOT;\r
-               if (quad[10][10]=='X') quad[10][10] = IHDOT;\r
+               if (frozen.quad[1][1]=='X') frozen.quad[1][1] = IHDOT;\r
+               if (frozen.quad[1][10]=='X') frozen.quad[1][10] = IHDOT;\r
+               if (frozen.quad[10][1]=='X') frozen.quad[10][1] = IHDOT;\r
+               if (frozen.quad[10][10]=='X') frozen.quad[10][10] = IHDOT;\r
        }               \r
 }\r
 \r
diff --git a/sst.h b/sst.h
index 78b8ca46d3b6b371fd83bf96a234e3240323b2c3..c6a1c87479a0951376a2b655a31d53c0864bf9a0 100644 (file)
--- a/sst.h
+++ b/sst.h
@@ -49,15 +49,13 @@ EXTERN struct foo {
            remtime;            // remaining time\r
 } state, snapsht;                      // Data that is snapshot\r
 \r
-EXTERN char\r
-               quad[11][11];   // contents of our quadrant\r
-\r
 // Scalar variables that are needed for freezing the game\r
 // are placed in a structure. #defines are used to access by their\r
 // original names. Gee, I could have done this with the d structure,\r
 // but I just didn't think of it back when I started.\r
 \r
 EXTERN struct foo2 {\r
+        char quad[11][11];     // contents of our quadrant\r
        int inkling,\r
        inbase,\r
        incom,\r