(lnd_pathcost): New, factored out of lnd_mobcost().
(att_reacting_units): Use it. Fixes overcharging of inefficient units. Broken when Empire3 changed land unit mobility use not to depend on efficiency, except for supply units. (lnd_sweep): Use it. No functional change. (speed_factor): New, factored out of lnd_pathcost() and shp_mobcost().
This commit is contained in:
parent
5e66e5bdee
commit
55ff194f7f
6 changed files with 27 additions and 24 deletions
|
@ -1442,7 +1442,7 @@ att_reacting_units(struct combat *def, struct emp_qelem *list, int a_spy,
|
|||
int dtotal;
|
||||
int new_land = 0;
|
||||
double mobcost;
|
||||
double move_cost;
|
||||
double pathcost;
|
||||
int dist;
|
||||
int radius;
|
||||
int origx, origy;
|
||||
|
@ -1506,15 +1506,10 @@ att_reacting_units(struct combat *def, struct emp_qelem *list, int a_spy,
|
|||
continue;
|
||||
|
||||
getsect(def->x, def->y, &dsect);
|
||||
if (!BestLandPath(buf, §, &dsect, &move_cost, MOB_MARCH))
|
||||
if (!BestLandPath(buf, §, &dsect, &pathcost, MOB_MARCH))
|
||||
continue;
|
||||
|
||||
mobcost = land.lnd_effic * 0.01 * lchr[(int)land.lnd_type].l_spd;
|
||||
if (mobcost < 0.01)
|
||||
mobcost = 0.01;
|
||||
mobcost = 480.0 / (mobcost + techfact(land.lnd_tech, mobcost));
|
||||
mobcost *= move_cost * 5.0;
|
||||
|
||||
mobcost = lnd_pathcost(&land, pathcost);
|
||||
if (land.lnd_mobil < mobcost)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue