Quiet the sensors.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 6 Feb 2005 22:04:32 +0000 (22:04 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 6 Feb 2005 22:04:32 +0000 (22:04 +0000)
io.c
planets.c
sst.c
sst.h

diff --git a/io.c b/io.c
index fc173f7182c0baac431cdb9363a5279f6447ed68..4830ea4595625b4b45bb12184fd6803d1eb06892 100644 (file)
--- a/io.c
+++ b/io.c
@@ -300,8 +300,8 @@ void drawmaps(short l)
 /* hook to be called after moving to redraw maps */
 {
     if (curses) {
-       if (l == 1) 
-           sensor();
+       if (l == 1)
+           sensor(FALSE);
        if (l != 2) {
            setwnd(srscan_window);
            wmove(curwnd, 0, 0);
index aaffdd4fe4a8835032ff63cee8e2d08164cf5c06..1d1d1b882cfd37812980baf3a5a7879cd8e05c5b 100644 (file)
--- a/planets.c
+++ b/planets.c
@@ -84,7 +84,7 @@ void orbit(void)
     ididit=1;
 }
 
-void sensor(void
+void sensor(int force
 {
     skip(1);
     chew();
@@ -92,11 +92,11 @@ void sensor(void)
        prout("Short range sensors damaged.");
        return;
     }
-    if (plnetx == 0) {
+    if (!plnetx && ((game.state.plnets[iplnet].known == unknown || force))) {
        prout("Spock- \"No planet in this quadrant, Captain.\"");
        return;
     }
-    if ((plnetx != 0)&&(game.state.plnets[iplnet].known == 0)) {
+    if ((plnetx != 0)&&(game.state.plnets[iplnet].known == unknown)) {
        prout("Spock-  \"Sensor scan for %s-", cramlc(quadrant, quadx, quady));
        skip(1);
        prout("         Planet at %s is of class %s.", 
diff --git a/sst.c b/sst.c
index 23e10016f42312fd7c8994f33b0ecffe3b5f9f58..8d30bde57ded84a318f15e690932dad7359a5020 100644 (file)
--- a/sst.c
+++ b/sst.c
@@ -372,7 +372,7 @@ static void makemoves(void) {
                                 score();
                                break;
                        case SENSORS:                   // sensors
-                               sensor();
+                               sensor(TRUE);
                                break;
                        case ORBIT:                     // orbit
                                orbit();
diff --git a/sst.h b/sst.h
index 5b68074186a972e7fc4c0b43c7141fa4406440f0..4a530631d9110719a973fdafe8d2fe6cc3f4a927 100644 (file)
--- a/sst.h
+++ b/sst.h
@@ -451,7 +451,7 @@ void prouts(char *, ...);
 int isit(char *);
 void preport(void);
 void orbit(void);
-void sensor(void);
+void sensor(int);
 void drawmaps(short);
 void beam(void);
 void mine(void);