diff options
author | rubidium <rubidium@openttd.org> | 2008-08-10 21:56:47 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-08-10 21:56:47 +0000 |
commit | 8726c2fd998b2c1f3f8020c9bd94904603b7e5a8 (patch) | |
tree | 2e36442017c9adc7289659c972b56c53ac66f37d /src/vehicle.cpp | |
parent | 2086f77daba836dc6cdb5204060adbca8e7377f3 (diff) | |
download | openttd-8726c2fd998b2c1f3f8020c9bd94904603b7e5a8.tar.xz |
(svn r14039) -Fix [FS#2217]: reversing an overlength train at a station would try to find a route out and sometimes reset the unload counter making it wait 2.5 years before departing instead of waiting until the train would actually leave the station (michi_cc)
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 555f1ddf0..305544137 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2345,8 +2345,16 @@ void Vehicle::LeaveStation() HideFillingPercent(this->fill_percent_te_id); this->fill_percent_te_id = INVALID_TE_ID; - /* Trigger station animation for trains only */ - if (this->type == VEH_TRAIN && IsTileType(this->tile, MP_STATION)) StationAnimationTrigger(st, this->tile, STAT_ANIM_TRAIN_DEPARTS); + if (this->type == VEH_TRAIN) { + /* Trigger station animation (trains only) */ + if (IsTileType(this->tile, MP_STATION)) StationAnimationTrigger(st, this->tile, STAT_ANIM_TRAIN_DEPARTS); + + /* Try to reserve a path when leaving the station as we + * might not be marked as wanting a reservation, e.g. + * when an overlenght train gets turned around in a station. + */ + TryPathReserve(this, true, true); + } } |