(svn r19425) -Fix: [YAPP] A train on a bridge/tunnel was not always found when checking for trains on a reserved path.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
michi_cc 15 years ago
parent e5cded6e36
commit 8c477604eb

@ -287,6 +287,11 @@ PBSTileInfo FollowTrainReservation(const Train *v, Vehicle **train_on_res)
if (ftoti.best != NULL) *train_on_res = ftoti.best->First();
}
}
if (*train_on_res == NULL && IsTileType(ftoti.res.tile, MP_TUNNELBRIDGE)) {
/* The target tile is a bridge/tunnel, also check the other end tile. */
FindVehicleOnPos(GetOtherTunnelBridgeEnd(ftoti.res.tile), &ftoti, FindTrainOnTrackEnum);
if (ftoti.best != NULL) *train_on_res = ftoti.best->First();
}
}
return ftoti.res;
}

Loading…
Cancel
Save