From a6dfef86203ce8cf59806554ce0239c54a1264ec Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 3 Oct 2006 18:19:39 +0000 Subject: [PATCH] Small cleanups discovered during Python translation. --- src/ai.c | 2 +- src/events.c | 9 +++++---- src/sst.h | 4 ++-- src/sst.py | 8 ++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/ai.c b/src/ai.c index 89b366d..67e748e 100644 --- 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 diff --git a/src/events.c b/src/events.c index a35c690..37a02d1 100644 --- a/src/events.c +++ b/src/events.c @@ -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)) || diff --git a/src/sst.h b/src/sst.h index ba44ecb..6a694b5 100644 --- 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 diff --git a/src/sst.py b/src/sst.py index d1b81bc..578e3f9 100644 --- a/src/sst.py +++ b/src/sst.py @@ -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) -- 2.31.1