(lnd_mobtype): New.
(lnd_path): Use it. (lnd_mobcost): Use it, remove last parameter. Callers changed. This fixes mobility use of trains when retreating, both for retreat orders and for failed morale checks. (retreat_land1): Fix test for impassable terrain. Before, trains could retreat off rail. (lnd_take_casualty): Test for impassable terrain. Before, trains could retreat off rail.
This commit is contained in:
parent
2e693275f1
commit
4e7c993a62
4 changed files with 31 additions and 26 deletions
|
@ -1038,7 +1038,8 @@ ask_olist(int combat_mode, struct combat *off, struct combat *def,
|
|||
switch (combat_mode) {
|
||||
case A_ATTACK:
|
||||
mobcost = lnd_pathcost(&land,
|
||||
att_mobcost(off->own, def, MOB_MARCH));
|
||||
att_mobcost(off->own, def,
|
||||
lnd_mobtype(&land)));
|
||||
if (land.lnd_mobil < mobcost) {
|
||||
pr("%s does not have enough mobility (%d needed)\n",
|
||||
prland(&land), (int)ceil(mobcost));
|
||||
|
@ -1530,7 +1531,8 @@ att_reacting_units(struct combat *def, struct emp_qelem *list, int a_spy,
|
|||
continue;
|
||||
|
||||
getsect(def->x, def->y, &dsect);
|
||||
if (!BestLandPath(buf, §, &dsect, &pathcost, MOB_MARCH))
|
||||
if (!BestLandPath(buf, §, &dsect, &pathcost,
|
||||
lnd_mobtype(&land)))
|
||||
continue;
|
||||
|
||||
mobcost = lnd_pathcost(&land, pathcost);
|
||||
|
@ -2529,7 +2531,8 @@ take_move_in_mob(int combat_mode, struct llist *llp, struct combat *off,
|
|||
switch (combat_mode) {
|
||||
case A_ATTACK:
|
||||
mobcost = lnd_pathcost(&llp->land,
|
||||
att_mobcost(off->own, def, MOB_MARCH));
|
||||
att_mobcost(off->own, def,
|
||||
lnd_mobtype(&llp->land)));
|
||||
new = llp->land.lnd_mobil - mobcost;
|
||||
if (new < -127)
|
||||
new = -127;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue