]> git.pond.sub.org Git - empserver/commitdiff
(SHP_AIROPS_EFF, LND_AIROPS_EFF): New. Use it instead of literal 50.
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 17 Aug 2004 18:31:32 +0000 (18:31 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 17 Aug 2004 18:31:32 +0000 (18:31 +0000)
include/land.h
include/ship.h
src/lib/subs/mission.c
src/lib/subs/plnsub.c

index 85d0e3f2c9a0700e649e855f4d9fe6c595113d11..b567dcad0931dc97b4f145a4797803e2be8c259b 100644 (file)
@@ -194,6 +194,10 @@ struct llist {
     int supplied;
 };
 
+enum {
+    LND_AIROPS_EFF = 50                /* min. efficiency for air ops */
+};
+
 /* src/lib/subs/lndsub.c */
 extern void lnd_sweep(struct emp_qelem *, int, int, natid);
 extern int lnd_interdict(struct emp_qelem *, coord, coord, natid);
index 0b715ca927343d586c1e6920dd35901224789626..1b265e9c407aed8afc66cf9f03bab6b915760b68 100644 (file)
@@ -214,6 +214,7 @@ struct mlist {
 #define CN_ERROR       (-1)
 
 enum {
+    SHP_AIROPS_EFF = 50,       /* min. efficiency for air ops */
     M_TORP_SHELLS = 3          /* number of shells used by a torpedo */
 };
 
index 9e9898032db005d04cd947a5352821455fc7abb8..114ef2b7631affa6e3aeb8ee238191dd3abd0cd8 100644 (file)
@@ -1115,8 +1115,8 @@ mission_pln_sel(struct emp_qelem *list, int wantflags, int nowantflags,
            if (ship.shp_effic < SHIP_MINEFF) {
                goto shipsunk;
            }
-           /* Can't fly off of ships < 50%, or non-owned or non-allied ships */
-           if ((ship.shp_effic < 50) ||
+           /* Can't fly off of inefficient or non-owned, non-allied ships */
+           if ((ship.shp_effic < SHP_AIROPS_EFF) ||
                ((ship.shp_own != pp->pln_own) &&
                 (getrel(getnatp(ship.shp_own), pp->pln_own) != ALLIED))) {
                emp_remque(qp);
@@ -1138,8 +1138,8 @@ mission_pln_sel(struct emp_qelem *list, int wantflags, int nowantflags,
            if (land.lnd_effic < LAND_MINEFF)
                goto landdead;
 
-           /* Can't fly off of units < 50%, or non-owned or non-allied units */
-           if ((land.lnd_effic < 50) ||
+           /* Can't fly off of inefficient or non-owned, non-allied units */
+           if ((land.lnd_effic < LND_AIROPS_EFF) ||
                ((land.lnd_own != pp->pln_own) &&
                 (getrel(getnatp(land.lnd_own), pp->pln_own) != ALLIED))) {
                emp_remque(qp);
index ed7f9ea3fae0ec477d7afc0958f32b8eda0dcbe4..09c5af4d48ea442131d183a7a32997a7ef731fba 100644 (file)
@@ -466,7 +466,7 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
                goto shipsunk;
            if (ship.shp_effic < SHIP_MINEFF)
                goto shipsunk;
-           if (ship.shp_effic < 50)
+           if (ship.shp_effic < SHP_AIROPS_EFF)
                continue;
            /* Can't fly off non-owned ships or non-allied ship */
            if ((ship.shp_own != player->cnum) &&
@@ -489,7 +489,7 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
                goto landdead;
            if (land.lnd_effic < LAND_MINEFF)
                goto landdead;
-           if (land.lnd_effic < 50)
+           if (land.lnd_effic < LND_AIROPS_EFF)
                continue;
            /* Can't fly off units in ships or other units */
            if ((land.lnd_ship >= 0) || (land.lnd_land >= 0))