Path finding for trains never worked; it ignored the need for rail:

(sector_mcost, bp_neighbors): Fix for MOB_RAIL and sct_rail == 0.
Closes #781528.
This commit is contained in:
Markus Armbruster 2006-06-04 17:27:17 +00:00
parent 20c02295a6
commit 6ab05ae8a1
2 changed files with 5 additions and 0 deletions

View file

@ -53,6 +53,8 @@ sector_mcost(struct sctstr *sp, int do_bonus)
if (do_bonus == MOB_ROAD) {
d = d / (1.0 + sp->sct_road / 122.0);
} else if (do_bonus == MOB_RAIL) {
if (sp->sct_rail <= 0)
return -1.0;
d = d / (1.0 + sp->sct_rail / 100.0);
} else {
if (d < 2.0)