Small cleanups discovered during Python translation.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 3 Oct 2006 18:19:39 +0000 (18:19 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 3 Oct 2006 18:19:39 +0000 (18:19 +0000)
src/ai.c
src/events.c
src/sst.h
src/sst.py

index 89b366d8be93921156104e3b4564dc32f02dab44..67e748eeeaa2590991fad3c183f37e06b93aa7c9 100644 (file)
--- a/src/ai.c
+++ b/src/ai.c
@@ -263,7 +263,7 @@ static void movebaddy(coord com, int loccom, feature ienm)
        if (!damaged(DSRSENS) || game.condition == docked) {
            proutn("***");
            cramen(ienm);
-           proutn(_(" from %s"), cramlc(2, com));
+           proutn(_(" from %s"), cramlc(sector, com));
            if (game.kdist[loccom] < dist1)
                proutn(_(" advances to "));
            else
index a35c690e4f61e735de9e18625959427fbd7f8d85..37a02d1bc92c93d81fc432fdd8a181e85fc26b32 100644 (file)
@@ -22,7 +22,7 @@ int is_scheduled(int evtype)
     return game.future[evtype].date != FOREVER;
 }
 
-extern double scheduled(int evtype)
+double scheduled(int evtype)
 /* when will this event happen? */
 {
     return game.future[evtype].date;
@@ -36,7 +36,7 @@ event *schedule(int evtype, double offset)
 }
 
 void postpone(int evtype, double offset)
-/* poistpone a scheduled event */
+/* postpone a scheduled event */
 {
     game.future[evtype].date += offset;
 }
@@ -80,7 +80,7 @@ void events(void)
            case FSCDBAS: proutn("=== SC Base Destroy "); break;
            case FDSPROB: proutn("=== Probe Move      "); break;
            case FDISTR:  proutn("=== Distress Call   "); break;
-           case FENSLV:  proutn("=== Enlavement      "); break;
+           case FENSLV:  proutn("=== Enslavement     "); break;
            case FREPRO:  proutn("=== Klingon Build   "); break;
            }
            if (is_scheduled(i))
@@ -166,7 +166,8 @@ void events(void)
        case FSPY: /* Check with spy to see if S.C. should tractor beam */
            if (game.state.nscrem == 0 ||
                ictbeam || istract ||
-               game.condition==docked || game.isatb==1 || game.iscate) return;
+               game.condition==docked || game.isatb==1 || game.iscate)
+               return;
            if (game.ientesc ||
                (game.energy < 2000 && game.torps < 4 && game.shield < 1250) ||
                (damaged(DPHASER) && (damaged(DPHOTON) || game.torps < 4)) ||
index ba44ecbc6603eb110589f1667f5eeed0ce23d12f..6a694b5a529bcad720ecf7d43b23688a4bbada6b 100644 (file)
--- a/src/sst.h
+++ b/src/sst.h
@@ -155,8 +155,8 @@ typedef struct {
 #define FOREVER        1e30
 
 /* Define future events */
-#define FSPY   0       // Spy event happens always (no future[] entry)
-                                       // can cause SC to tractor beam Enterprise
+#define FSPY   0   // Spy event happens always (no future[] entry)
+                   // can cause SC to tractor beam Enterprise
 #define FSNOVA  1   // Supernova
 #define FTBEAM  2   // Commander tractor beams Enterprise
 #define FSNAP   3   // Snapshot for time warp
index d1b81bcf14a9e7920ecda45574db6d665da9e3c8..578e3f9a3f9975fdf67ea21a45aae4304eb559fd 100644 (file)
@@ -693,7 +693,7 @@ def movescom(iq, avoid):
            game.state.planets[i].pclass = destroyed
            game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].planet = NOPLANET
            if not damaged(DRADIO) or game.condition == docked:
-               pause_game(True)
+               announce()
                prout(_("Lt. Uhura-  \"Captain, Starfleet Intelligence reports"))
                proutn(_("   a planet in Quadrant %s has been destroyed") % game.state.kscmdr)
                prout(_("   by the Super-commander.\""))
@@ -798,7 +798,7 @@ def supercommander():
                if damaged(DRADIO) and game.condition != docked:
                    return; # no warning 
                game.iseenit = True
-               pause_game(True)
+               announce()
                prout(_("Lt. Uhura-  \"Captain, the starbase in Quadrant %s") \
                       % game.state.kscmdr)
                prout(_("   reports that it is under attack from the Klingon Super-commander."))
@@ -818,7 +818,7 @@ def supercommander():
         (damaged(DRADIO) and game.condition != docked) or \
         not game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].charted):
        return
-    pause_game(True)
+    announce()
     prout(_("Lt. Uhura-  \"Captain, Starfleet Intelligence reports"))
     proutn(_("   the Super-commander is in Quadrant %s,") % game.state.kscmdr)
     return;
@@ -1084,7 +1084,7 @@ def ram(ibumpd, ienm, w):
     game.shldup = False
     prout(_("***Shields are down."))
     if game.state.remkl + game.state.remcom + game.state.nscrem:
-       pause_game(True)
+       announce()
        damagereport()
     else:
        finish(FWON)