From ab2b930b5bcfa977630cbf080b730e9e73110203 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 14 Jun 2008 19:13:30 +0200 Subject: [PATCH] Let spy report on unoccupied sectors 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 | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/lib/commands/spy.c b/src/lib/commands/spy.c index 290ea0566..4480acfa1 100644 --- a/src/lib/commands/spy.c +++ b/src/lib/commands/spy.c @@ -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) { -- 2.43.0