march: Don't permit trains to march out of sectors without rail

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2014-12-28 19:58:52 +01:00
parent f0e6551461
commit d87bd96496
4 changed files with 18 additions and 5 deletions

View file

@ -499,6 +499,19 @@ lnd_mar(struct emp_qelem *list, double *minmobp, double *maxmobp,
lnd_stays(actor, "has no mil on it to guide it", llp);
continue;
}
switch (lnd_check_mar(lp, &sect)) {
case LND_STUCK_NOT:
break;
case LND_STUCK_NO_RAIL:
lnd_stays(actor, "is stuck off the rail system", llp);
continue;
default:
CANT_REACH();
/* fall through */
case LND_STUCK_IMPASSABLE:
lnd_stays(actor, "is stuck", llp);
continue;
}
if (relations_with(sect.sct_own, actor) != ALLIED &&
!(lchr[lp->lnd_type].l_flags & L_SPY) &&
sect.sct_own) {