]> git.pond.sub.org Git - empserver/commitdiff
Remove takeover_ship() and takeover_land() parameter hostile
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 14 Sep 2008 15:30:55 +0000 (11:30 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 15 Sep 2008 23:40:44 +0000 (19:40 -0400)
All callers pass non-zero.  Simplify accordingly.

include/prototypes.h
src/lib/subs/attsub.c
src/lib/subs/takeover.c

index 8efbcf1ee6017dd9e2393337393a7eca3eadf770..cfc98cb807c5b134418082f5c3d2e4ceafabb40b 100644 (file)
@@ -686,9 +686,9 @@ extern void resupply_commod(struct lndstr *, i_type);
 extern int supply_commod(int, int, int, i_type, int);
 extern int has_supply(struct lndstr *);
 /* takeover.c */
-extern void takeover_land(struct lndstr *, natid, int);
+extern void takeover_land(struct lndstr *, natid);
 extern void takeover(struct sctstr *, natid);
-extern void takeover_ship(struct shpstr *, natid, int);
+extern void takeover_ship(struct shpstr *, natid);
 extern void takeover_plane(struct plnstr *, natid);
 /* trdsub.c */
 /* trechk.c */
index 8895239e0f3156a1bf9c0f840a95294e3ad66b51..b541283e1bcd17b3f6cf79cc80beec5bbc8d283c 100644 (file)
@@ -2251,11 +2251,11 @@ take_def(int combat_mode, struct emp_qelem *list, struct combat *off,
        putsect(&sect);
     } else if (def->type == EF_SHIP) {
        getship(def->shp_uid, &ship);
-       takeover_ship(&ship, player->cnum, 1);
+       takeover_ship(&ship, player->cnum);
        putship(ship.shp_uid, &ship);
     } else if (def->type == EF_LAND) {
        getland(def->lnd_uid, &land);
-       takeover_land(&land, player->cnum, 1);
+       takeover_land(&land, player->cnum);
        putland(land.lnd_uid, &land);
     }
     if (delete_me)
index 06ef288985c5f8fe6246c61195c39727aeaca181..2c23a077bfee8caf1ae2caee31b83365bdf1a0dc 100644 (file)
@@ -113,7 +113,7 @@ takeover(struct sctstr *sp, natid newown)
               prland(lp),
               cname(newown), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
        }
-       takeover_land(lp, newown, 1);
+       takeover_land(lp, newown);
     }
 
     sp->sct_avail = 0;
@@ -211,7 +211,7 @@ takeover_plane(struct plnstr *pp, natid newown)
 }
 
 void
-takeover_ship(struct shpstr *sp, natid newown, int hostile)
+takeover_ship(struct shpstr *sp, natid newown)
 {
     struct plnstr *pp;
     struct lndstr *lp;
@@ -231,10 +231,8 @@ takeover_ship(struct shpstr *sp, natid newown, int hostile)
     /* Take over planes */
     snxtitem_cargo(&ni, EF_PLANE, EF_SHIP, sp->shp_uid);
     while (nxtitem(&ni, pp)) {
-       if (hostile) {
-           if (pp->pln_effic > PLANE_MINEFF)
-               pp->pln_effic = PLANE_MINEFF;
-       }
+       if (pp->pln_effic > PLANE_MINEFF)
+           pp->pln_effic = PLANE_MINEFF;
        pp->pln_mobil = 0;
        if (opt_MOB_ACCESS)
            game_tick_to_now(&pp->pln_access);
@@ -247,12 +245,12 @@ takeover_ship(struct shpstr *sp, natid newown, int hostile)
     /* Take over land units */
     snxtitem_cargo(&ni, EF_LAND, EF_SHIP, sp->shp_uid);
     while (nxtitem(&ni, lp))
-       takeover_land(lp, newown, hostile);
+       takeover_land(lp, newown);
     putship(sp->shp_uid, sp);
 }
 
 void
-takeover_land(struct lndstr *landp, natid newown, int hostile)
+takeover_land(struct lndstr *landp, natid newown)
 {
     struct plnstr *pp;
     struct lndstr *lp;
@@ -278,10 +276,8 @@ takeover_land(struct lndstr *landp, natid newown, int hostile)
     /* Take over planes */
     snxtitem_cargo(&ni, EF_PLANE, EF_LAND, landp->lnd_uid);
     while (nxtitem(&ni, pp)) {
-       if (hostile) {
-           if (pp->pln_effic > PLANE_MINEFF)
-               pp->pln_effic = PLANE_MINEFF;
-       }
+       if (pp->pln_effic > PLANE_MINEFF)
+           pp->pln_effic = PLANE_MINEFF;
        pp->pln_mobil = 0;
        if (opt_MOB_ACCESS)
            game_tick_to_now(&pp->pln_access);
@@ -294,6 +290,6 @@ takeover_land(struct lndstr *landp, natid newown, int hostile)
     /* Take over land units */
     snxtitem_cargo(&ni, EF_LAND, EF_LAND, landp->lnd_uid);
     while (nxtitem(&ni, lp))
-       takeover_land(lp, newown, hostile);
+       takeover_land(lp, newown);
     putland(landp->lnd_uid, landp);
 }