]> git.pond.sub.org Git - empserver/commitdiff
(ship_grow_scale, plane_grow_scale, land_grow_scale): Change from int
authorRon Koenderink <rkoenderink@yahoo.ca>
Tue, 5 Apr 2005 03:00:35 +0000 (03:00 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Tue, 5 Apr 2005 03:00:35 +0000 (03:00 +0000)
to float.  This allows more control of the max. efficiency gain, and
makes it similiar to ship_mob_scale etc.  Closes #1025600.

include/econfig-spec.h
src/lib/commands/vers.c
src/lib/global/constants.c
src/lib/update/land.c
src/lib/update/plane.c
src/lib/update/ship.c

index 96e2ebdc4ccd388cee167ae1416e3429f50bea40..4c3fdd849358d6b00de43c9421009d6d6a4371f3 100644 (file)
@@ -177,7 +177,7 @@ EMPCFBOTH("buil_tower_bt", buil_tower_bt, double, NSC_DOUBLE, 0,
 EMPCF_COMMENT("\n\n### Land Units")
 EMPCFBOTH("land_mob_scale", land_mob_scale, float, NSC_FLOAT, 0,
     "Land unit mobility accumulation (land_mob_scale * ETUs per update)")
-EMPCFBOTH("land_grow_scale", land_grow_scale, int, NSC_INT, 0,
+EMPCFBOTH("land_grow_scale", land_grow_scale, float, NSC_FLOAT, 0,
     "How fast efficiency grows for land units each update (* ETUs)")
 EMPCFBOTH("land_mob_max", land_mob_max, int, NSC_INT, 0,
     "Maximum mobility for land units")
@@ -189,7 +189,7 @@ EMPCFBOTH("morale_base", morale_base, int, NSC_INT, KM_INTERNAL,
 EMPCF_COMMENT("\n\n### Planes")
 EMPCFBOTH("plane_mob_scale", plane_mob_scale, float, NSC_FLOAT, 0,
     "Plane mobility accumulation (plane_mob_scale * ETUs per update)")
-EMPCFBOTH("plane_grow_scale", plane_grow_scale, int, NSC_INT, 0,
+EMPCFBOTH("plane_grow_scale", plane_grow_scale, float, NSC_FLOAT, 0,
     "How fast efficiency grows for planes each update (* ETUs)")
 EMPCFBOTH("plane_mob_max", plane_mob_max, int, NSC_INT, 0,
     "Maximum mobility for planes")
@@ -199,7 +199,7 @@ EMPCFBOTH("money_plane", money_plane, double, NSC_DOUBLE, 0,
 EMPCF_COMMENT("\n\n### Ships")
 EMPCFBOTH("ship_mob_scale", ship_mob_scale, float, NSC_FLOAT, 0,
     "Ship mobility accumulation (ship_mob_scale * ETUs per update)")
-EMPCFBOTH("ship_grow_scale", ship_grow_scale, int, NSC_INT, 0,
+EMPCFBOTH("ship_grow_scale", ship_grow_scale, float, NSC_FLOAT, 0,
     "How fast efficiency grows for ships each update (* ETUs)")
 EMPCFBOTH("ship_mob_max", ship_mob_max, int, NSC_INT, 0,
     "Maximum mobility for ships")
index 364703d31705a7d5d5d741766e42238c15bd1ab7..085b9d69d6468e4e7ef5c9dd1d0e4bebaa1d5b8f 100644 (file)
@@ -133,9 +133,9 @@ vers(void)
        (int)(plane_mob_scale * (float)etu_per_update),
        (int)(land_mob_scale * (float)etu_per_update));
     pr("Max eff gain per update\t\t--\t%d\t%d\t%d\n",
-       min(ship_grow_scale * etu_per_update, 100),
-       min(plane_grow_scale * etu_per_update, 100),
-       min(land_grow_scale * etu_per_update, 100));
+       min((int)(ship_grow_scale * (float)etu_per_update), 100),
+       min((int)(plane_grow_scale * (float)etu_per_update), 100),
+       min((int)(land_grow_scale * (float)etu_per_update), 100));
     pr("\n");
     pr("Ships on autonavigation may use %i cargo holds per ship.\n", TMAX);
     if (opt_TRADESHIPS) {
index 1b27a8b6a39262aae1b033c445154754c3e134f4..2a60501f1598ccf3e0c73014a73086d8673539bc 100644 (file)
@@ -107,9 +107,9 @@ int start_unit_type[START_UNITS] = { 0, 1 };        /* type of unit */
 /* opt_FUEL */
 int fuel_mult = 10;            /* 1 fuel = 10 mob */
 
-int land_grow_scale = 2;       /* how fast eff grows for land units (xETUS) */
-int ship_grow_scale = 3;       /* how fast eff grows for ships (xETUS) */
-int plane_grow_scale = 2;      /* how fast eff grows for planes (xETUS) */
+float land_grow_scale = 2.0;   /* how fast eff grows for land units (xETUS) */
+float ship_grow_scale = 3.0;   /* how fast eff grows for ships (xETUS) */
+float plane_grow_scale = 2.0;  /* how fast eff grows for planes (xETUS) */
 
 double fgrate = 0.0012;                /* food growth rate (dt * fert) */
 double fcrate = 0.0013;                /* food cultivate rate (dt * workforce) */
index 092027184599d8dfc166e798e24058c72589711b..3614918fc24267859d6a7d47234629ace6df3564 100644 (file)
@@ -269,8 +269,8 @@ landrepair(struct lndstr *land, struct natstr *np,
     delta = roundavg((double)avail / w_p_eff);
     if (delta <= 0)
        return 1;
-    if (delta > etus * land_grow_scale)
-       delta = etus * land_grow_scale;
+    if (delta > (int)((float)etus * land_grow_scale))
+       delta = (int)((float)etus * land_grow_scale);
 
     /* delta is the max amount we can grow */
 
index 2be2f54522435a09dba14fe21ea2c1d31f5f7874..8e64ae2ae7c1db442fca8eb305e670fff8be2055 100644 (file)
@@ -182,8 +182,8 @@ prod_plane(int etus, int natnum, int *bp, int buildem)
            delta = roundavg((double)avail / w_p_eff);
            if (delta <= 0)
                continue;
-           if (delta > etus * plane_grow_scale)
-               delta = etus * plane_grow_scale;
+           if (delta > (int)((float)etus * plane_grow_scale))
+               delta = (int)((float)etus * plane_grow_scale);
            if (delta > left)
                delta = left;
 
index a597e1fe2ea86c42ea527189eb52b5dcc4b69bb3..5e8e5652b5dea3ff70a619f3c45257c226204066 100644 (file)
@@ -333,8 +333,8 @@ shiprepair(struct shpstr *ship, struct natstr *np,
     delta = roundavg((double)avail / w_p_eff);
     if (delta <= 0)
        return 1;
-    if (delta > etus * ship_grow_scale)
-       delta = etus * ship_grow_scale;
+    if (delta > (int)((float)etus * ship_grow_scale))
+       delta = (int)((float)etus * ship_grow_scale);
     if (delta > left)
        delta = left;