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

This commit is contained in:
michi_cc 2010-03-14 20:57:23 +00:00
parent e5cded6e36
commit 8c477604eb

View File

@ -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;
}