Stash orbital height in gane structure in case we save while in orbit.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 7 Feb 2005 13:16:38 +0000 (13:16 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 7 Feb 2005 13:16:38 +0000 (13:16 +0000)
TODO
planets.c
sst.h

diff --git a/TODO b/TODO
index d546f6a61439a65cb14bdff3a71416be2e00ab23..a0580811e612dcd91d3ea8616436004a315f036d 100644 (file)
--- a/TODO
+++ b/TODO
@@ -7,6 +7,4 @@
 * Code to hurl you out of quadrant if a supernova occurs as you warp in 
   seems to hang.
 
 * Code to hurl you out of quadrant if a supernova occurs as you warp in 
   seems to hang.
 
-* "Bases left" report doesn't look right in the -t version.
-
 * Orbit height is negative.
 * Orbit height is negative.
index 057fb84dbd1cd3bdd0af04efb5c707e12dda6ef4..5cf8965784186dab691972d1ad5dff1f73fa7d1a 100644 (file)
--- a/planets.c
+++ b/planets.c
@@ -1,7 +1,5 @@
 #include "sst.h"
 
 #include "sst.h"
 
-static int height;
-
 static char *classes[] = {"M","N","O"};
 
 static int consumeTime(void) 
 static char *classes[] = {"M","N","O"};
 
 static int consumeTime(void) 
@@ -71,15 +69,15 @@ void orbit(void)
     }
     if (plnetx == 0 || abs(sectx-plnetx) > 1 || abs(secty-plnety) > 1) {
        crmshp();
     }
     if (plnetx == 0 || abs(sectx-plnetx) > 1 || abs(secty-plnety) > 1) {
        crmshp();
-       prout(" not adjacient to planet.\n");
+       prout(" not adjacent to planet.\n");
        return;
     }
     Time = 0.02+0.03*Rand();
     prout("Helmsman Sulu-  \"Entering standard orbit, Sir.\"");
     newcnd();
     if (consumeTime()) return;
        return;
     }
     Time = 0.02+0.03*Rand();
     prout("Helmsman Sulu-  \"Entering standard orbit, Sir.\"");
     newcnd();
     if (consumeTime()) return;
-    height = (1400.+7200.*Rand());
-    prout("Sulu-  \"Entered orbit at altitude %.2f kilometers.\"", height);
+    game.height = (1400.0+7200.0*Rand());
+    prout("Sulu-  \"Entered orbit at altitude %.2f kilometers.\"", game.height);
     inorbit = 1;
     ididit=1;
 }
     inorbit = 1;
     ididit=1;
 }
@@ -319,7 +317,7 @@ void shuttle(void)
        prout("  you may not fly down.\"");
        return;
     }
        prout("  you may not fly down.\"");
        return;
     }
-    Time = 3.0e-5*height;
+    Time = 3.0e-5*game.height;
     if (Time >= 0.8*game.state.remtime) {
        prout("First Officer Spock-  \"Captain, I compute that such");
        proutn("  a maneuver would require approximately 2d%% of our",
     if (Time >= 0.8*game.state.remtime) {
        prout("First Officer Spock-  \"Captain, I compute that such");
        proutn("  a maneuver would require approximately 2d%% of our",
diff --git a/sst.h b/sst.h
index 9a67c1d063ac1dd44cafcb6a6d15c34ff7edc51c..78596102d81c987fcc8c7018ac48fe7f5c2336e3 100644 (file)
--- a/sst.h
+++ b/sst.h
@@ -212,7 +212,8 @@ EXTERN struct {
        probex,
        probey,
        probeinx,
        probex,
        probey,
        probeinx,
-       probeiny;
+       probeiny,
+       height;
 } game;
 
 #define inkling game.inkling           // Initial number of klingons
 } game;
 
 #define inkling game.inkling           // Initial number of klingons