]> git.pond.sub.org Git - empserver/commitdiff
Revert "subs: Add unitsatxy() parameter only_count"
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 14 May 2016 20:13:57 +0000 (22:13 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 11:59:45 +0000 (13:59 +0200)
This reverts commit 9b33a4c59824a249ee6f04a94045bcb1f93f4f77.

Parameter only_count was introduced so would_abandon() could use
unitsatxy(), but that was a flawed idea, fixed in the previous commit.
No callers passing non-zero remain, so get rid of it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/prototypes.h
src/lib/commands/bomb.c
src/lib/subs/list.c

index bc32b069f7257c95d73b4cb2de2e546a9fca0399..389f30664873606feb900ffc9fd48522fd4a0e9f 100644 (file)
@@ -446,7 +446,7 @@ extern int roundrange(double);
 /* list.c */
 extern int shipsatxy(coord, coord, int, int, int);
 extern int carriersatxy(coord, coord, natid);
-extern int unitsatxy(coord, coord, int, int, int);
+extern int unitsatxy(coord, coord, int, int);
 extern int planesatxy(coord, coord, int, int);
 extern int asw_shipsatxy(coord, coord, int, int, struct plnstr *,
                         struct shiplist **);
index a88dfe02b911ff29ac88b5c1857ea5a5851fd87d..900283d8354ef590ec5b8a6bd475b4b4931d85f7 100644 (file)
@@ -194,7 +194,7 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
            pr("Some subs are present in the sector.\n");
     }
     nplanes = planesatxy(target->sct_x, target->sct_y, 0, 0);
-    nunits = unitsatxy(target->sct_x, target->sct_y, 0, 0, 0);
+    nunits = unitsatxy(target->sct_x, target->sct_y, 0, 0);
   retry:
     p = getstring("Bomb what? (ship, plane, land unit, efficiency, commodities) ",
                  buf);
@@ -599,7 +599,7 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       nunits = unitsatxy(target->sct_x, target->sct_y, 0, 0, 0);
+       nunits = unitsatxy(target->sct_x, target->sct_y, 0, 0);
        if (nunits == 0) {
            pr("%s could not find any units!\n", prplane(&plp->plane));
            continue;
@@ -615,7 +615,7 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
            if (*q == '~')
                break;
            if (*q == '?') {
-               unitsatxy(target->sct_x, target->sct_y, 0, 0, 0);
+               unitsatxy(target->sct_x, target->sct_y, 0, 0);
                continue;
            }
            n = atoi(q);
index b8e50dec0c6e733cad36b14b763baeae68c368ae..0cfe76d5f99b5b0be41760a0ad46641294231c0e 100644 (file)
@@ -113,7 +113,7 @@ carriersatxy(coord x, coord y, natid own)
 }
 
 int
-unitsatxy(coord x, coord y, int wantflags, int nowantflags, int only_count)
+unitsatxy(coord x, coord y, int wantflags, int nowantflags)
 {
     int units;
     struct nstr_item ni;
@@ -144,12 +144,10 @@ unitsatxy(coord x, coord y, int wantflags, int nowantflags, int only_count)
                continue;
        }
 
-       if (!only_count) {
-           if (!units)
-               pr(" #          owner           eff       type\n");
-           pr("(#%3d) %10.10s  %12.12s  %s\n", ni.cur,
-              cname(land.lnd_own), effadv(land.lnd_effic), prland(&land));
-       }
+       if (!units)
+           pr(" #          owner           eff       type\n");
+       pr("(#%3d) %10.10s  %12.12s  %s\n", ni.cur,
+          cname(land.lnd_own), effadv(land.lnd_effic), prland(&land));
        units++;
     }
     return units;