]> git.pond.sub.org Git - empserver/commitdiff
Let spy report on unoccupied sectors
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 14 Jun 2008 17:13:30 +0000 (19:13 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 15 Jun 2008 06:49:21 +0000 (08:49 +0200)
Make spy() not skip sectors without civilians, military and land
units.  There could be other interesting things to report there:
efficiency, gold bars, planes...

src/lib/commands/spy.c

index 290ea056672a4a8e0a8a4e850e2849104b35b0f5..4480acfa1f26fd75d8a15d811de051ee13cd3f00 100644 (file)
@@ -49,7 +49,6 @@
 
 static int check(coord *table, int *len, coord x, coord y);
 static void insert(coord *table, int *len, coord x, coord y);
-static int num_units(int, int);
 static void spy_report(struct sctstr *sp);
 static void prplanes(int, int);
 static void prunits(int, int);
@@ -137,14 +136,8 @@ spy(void)
                continue;
            }
            getsect(nx, ny, &dsect);
-           if (player->owner
-               || (dsect.sct_type == SCT_WATER)
-               || (!dsect.sct_item[I_MILIT] && !dsect.sct_item[I_CIVIL]
-                   && num_units(nx, ny) == 0)) {
-               /* mark sector as seen */
-               insert(table, &t_len, nx, ny);
+           if (player->owner || dsect.sct_type == SCT_WATER)
                continue;
-           }
 
            own = dsect.sct_own;
            relat = getrel(getnatp(own), player->cnum);
@@ -248,25 +241,6 @@ check(coord *table, int *len, coord x, coord y)
     return 0;
 }
 
-static int
-num_units(int x, int y)
-{
-    struct lndstr land;
-    struct nstr_item ni;
-    int n = 0;
-
-    snxtitem_xy(&ni, EF_LAND, x, y);
-    while (nxtitem(&ni, &land)) {
-       if ((land.lnd_own == player->cnum) || (land.lnd_own == 0))
-           continue;
-       if (land.lnd_ship >= 0 || land.lnd_land >= 0)
-           continue;
-       n++;
-    }
-
-    return n;
-}
-
 static void
 prunits(int x, int y)
 {