(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
|
@ -458,11 +458,10 @@ retreat_land1(struct lndstr *lp, char code, int orig)
|
|||
newy = ynorm(lp->lnd_y + dy);
|
||||
|
||||
getsect(newx, newy, §);
|
||||
if ((sect.sct_type == SCT_WATER) ||
|
||||
(sect.sct_type == SCT_MOUNT) ||
|
||||
(sect.sct_type == SCT_SANCT) ||
|
||||
(sect.sct_type == SCT_WASTE) ||
|
||||
(sect.sct_own != lp->lnd_own)) {
|
||||
mobcost = lnd_mobcost(lp, §);
|
||||
if (mobcost < 0
|
||||
|| sect.sct_type == SCT_MOUNT
|
||||
|| sect.sct_own != lp->lnd_own) {
|
||||
wu(0, lp->lnd_own, "%s %s,\nbut could not retreat to %s!\n",
|
||||
prland(lp),
|
||||
conditions[findcondition(code)].desc[orig],
|
||||
|
@ -471,7 +470,6 @@ retreat_land1(struct lndstr *lp, char code, int orig)
|
|||
putland(lp->lnd_uid, lp);
|
||||
return 0;
|
||||
}
|
||||
mobcost = lnd_mobcost(lp, §, MOB_MARCH);
|
||||
lp->lnd_x = newx;
|
||||
lp->lnd_y = newy;
|
||||
lp->lnd_mobil -= mobcost;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue