]> git.pond.sub.org Git - empserver/commitdiff
subs: Drop has_units() parameter lp, it's always null now
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 28 Dec 2014 20:59:05 +0000 (21:59 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 28 Feb 2015 15:13:14 +0000 (16:13 +0100)
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/prototypes.h
src/lib/subs/list.c
src/lib/subs/sect.c
src/lib/update/plague.c
src/lib/update/populace.c
src/lib/update/sect.c

index d569033e2ba4d206381dfa9110dcca2c57ad95a2..729c561eabf8bf362c22c86aeafbaede4af32e83 100644 (file)
@@ -452,7 +452,7 @@ extern int unitsatxy(coord, coord, int, int, int);
 extern int planesatxy(coord, coord, int, int);
 extern int asw_shipsatxy(coord, coord, int, int, struct plnstr *,
                         struct shiplist **);
-extern int has_units(coord, coord, natid, struct lndstr *);
+extern int has_units(coord, coord, natid);
 extern int adj_units(coord, coord, natid);
 extern int islist(char *);
 /* maps.c */
index 32c6f81316bca9c9183fe985c8f7a6465f163c6d..e78cde2b91dfc33c4fd5abfbb7f93f7ee6b333b6 100644 (file)
@@ -256,14 +256,14 @@ adj_units(coord x, coord y, natid own)
 
     for (i = DIR_FIRST; i <= DIR_LAST; i++) {
        getsect(x + diroff[i][0], y + diroff[i][1], &sect);
-       if (has_units(sect.sct_x, sect.sct_y, own, NULL))
+       if (has_units(sect.sct_x, sect.sct_y, own))
            return 1;
     }
     return 0;
 }
 
 int
-has_units(coord x, coord y, natid cn, struct lndstr *lp)
+has_units(coord x, coord y, natid cn)
 {
     int n;
     struct lndstr land;
@@ -271,12 +271,6 @@ has_units(coord x, coord y, natid cn, struct lndstr *lp)
     for (n = 0; ef_read(EF_LAND, n, &land); n++) {
        if (land.lnd_x != x || land.lnd_y != y)
            continue;
-       if (lp) {
-           /* Check this unit.  If it is this one, we don't want
-              it included in the count. */
-           if (lp->lnd_uid == land.lnd_uid)
-               continue;
-       }
        if (land.lnd_own == cn)
            return 1;
     }
index e25fbc4582d5b55b7c9aa1931adeab3404309ddd..7929db5e59488f39d6b29d3484fefc432d17ebb5 100644 (file)
@@ -29,7 +29,7 @@
  *  Known contributors to this file:
  *     Dave Pare, 1989
  *     Steve McClure, 1996
- *     Markus Armbruster, 2004-2013
+ *     Markus Armbruster, 2004-2014
  */
 
 #include <config.h>
@@ -83,7 +83,7 @@ sct_prewrite(int id, void *old, void *new)
        sp->sct_oldown = own;
     }
 
-    if (own && !civs && !mil && !has_units(sp->sct_x, sp->sct_y, own, NULL)
+    if (own && !civs && !mil && !has_units(sp->sct_x, sp->sct_y, own)
        && !(sp->sct_flags & MOVE_IN_PROGRESS)) {
        /* more cruft! */
        own = sp->sct_own = 0;
index 68de8cb1ff16afe79d66c866b220c59d5c55e8fa..b722265f1a933bf65e258638b1096a840851540f 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Steve McClure, 1998-2000
- *     Markus Armbruster, 2004-2012
+ *     Markus Armbruster, 2004-2014
  */
 
 #include <config.h>
@@ -100,7 +100,7 @@ do_plague(struct sctstr *sp, struct natstr *np, int etu)
        }
     }
     if (sp->sct_item[I_CIVIL] == 0 && sp->sct_item[I_MILIT] == 0
-       && !has_units(sp->sct_x, sp->sct_y, sp->sct_own, NULL)) {
+       && !has_units(sp->sct_x, sp->sct_y, sp->sct_own)) {
        makelost(EF_SECTOR, sp->sct_own, 0, sp->sct_x, sp->sct_y);
        sp->sct_own = 0;
        sp->sct_oldown = 0;
index 91151980a0e966c7cfcc2c3594bcbf245decd93c..0cf2dc9ece5f81fec52c2f2d3f72069aa2c55f8a 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Dave Pare, 1986
- *     Markus Armbruster, 2004-2013
+ *     Markus Armbruster, 2004-2014
  */
 
 #include <config.h>
@@ -51,7 +51,7 @@ populace(struct natstr *np, struct sctstr *sp, int etu)
        sp->sct_oldown = sp->sct_own;
     }
     if (!civ && !mil && !sp->sct_item[I_UW]
-       && !has_units(sp->sct_x, sp->sct_y, sp->sct_own, NULL)) {
+       && !has_units(sp->sct_x, sp->sct_y, sp->sct_own)) {
        makelost(EF_SECTOR, sp->sct_own, 0, sp->sct_x, sp->sct_y);
        sp->sct_own = 0;
        sp->sct_oldown = 0;
index e324b279167a2030a5945ea5337a0990ca923172..5f348a6a4d761b5f6ad316c33003e7ccd211438c 100644 (file)
@@ -29,7 +29,7 @@
  *  Known contributors to this file:
  *     Dave Pare, 1986
  *     Steve McClure, 1996
- *     Markus Armbruster, 2004-2013
+ *     Markus Armbruster, 2004-2014
  */
 
 #include <config.h>
@@ -287,7 +287,7 @@ produce_sect(int natnum, int etu, struct bp *bp, int p_sect[][2])
         * they all starved or were plagued off.
         */
        if (vec[I_CIVIL] == 0 && vec[I_MILIT] == 0 &&
-           !has_units(sp->sct_x, sp->sct_y, sp->sct_own, NULL)) {
+           !has_units(sp->sct_x, sp->sct_y, sp->sct_own)) {
            if (!player->simulation) {
                makelost(EF_SECTOR, sp->sct_own, 0, sp->sct_x, sp->sct_y);
                sp->sct_own = 0;