From: Markus Armbruster Date: Sun, 14 Sep 2008 15:30:55 +0000 (-0400) Subject: Remove takeover_ship() and takeover_land() parameter hostile X-Git-Tag: v4.3.17~17 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=69b74bb5ddee6dcd3a4a60892fab14ddc59b8f8c Remove takeover_ship() and takeover_land() parameter hostile All callers pass non-zero. Simplify accordingly. --- diff --git a/include/prototypes.h b/include/prototypes.h index 8efbcf1ee..cfc98cb80 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -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 */ diff --git a/src/lib/subs/attsub.c b/src/lib/subs/attsub.c index 8895239e0..b541283e1 100644 --- a/src/lib/subs/attsub.c +++ b/src/lib/subs/attsub.c @@ -2251,11 +2251,11 @@ take_def(int combat_mode, struct emp_qelem *list, struct combat *off, putsect(§); } 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) diff --git a/src/lib/subs/takeover.c b/src/lib/subs/takeover.c index 06ef28898..2c23a077b 100644 --- a/src/lib/subs/takeover.c +++ b/src/lib/subs/takeover.c @@ -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); }