- for_quadrants(i)
- for_quadrants(j)
- if (game.state.galaxy[i][j].charted) {
- game.state.chart[i][j].klingons = game.state.galaxy[i][j].klingons;
- game.state.chart[i][j].starbase = game.state.galaxy[i][j].starbase;
- game.state.chart[i][j].stars = game.state.galaxy[i][j].stars;
- }
+ for (i = 1; i <= GALSIZE; i++)
+ for (j = 1; j <= GALSIZE; j++)
+ rechart_quad(i, j);
+}
+
+static void rechart_lr(void)
+/* update the chart in the Enterprise's computer from galaxy data */
+{
+ int i, j;
+ for (i = game.quadrant.x-1; i <= game.quadrant.x+1; i++) {
+ for (j = game.quadrant.y-1; j <= game.quadrant.y+1; j++) {
+ if (i == game.quadrant.x && j == game.quadrant.y)
+ continue;
+ rechart_quad(i, j);
+ }
+ }
+}
+
+static void rechart_sr(void)
+/* update the chart in the Enterprise's computer from galaxy data */
+{
+ rechart_quad(game.quadrant.x, game.quadrant.y);
+}
+
+void rechart(void)
+{
+ if (!damaged(DRADIO) || game.condition == docked) {
+ if (game.lastchart < game.state.date && game.condition == docked)
+ prout(_("Spock- \"I revised the Star Chart from the "
+ "starbase's records.\""));
+ rechart_dsradio();
+ } else {
+ if (!damaged(DLRSENS))
+ rechart_lr();
+ if (!damaged(DSRSENS))
+ rechart_sr();
+ }