summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2008-11-02 19:32:24 +0000
committermichi_cc <michi_cc@openttd.org>2008-11-02 19:32:24 +0000
commit808d9255a8e68fa34bdb51eccdd4db4a347268ed (patch)
tree075b630eaffde97dc620e5cc8bd4bd97314013ed /src
parentf649496caafb2946d982dbea84d7232e4fb3f3c9 (diff)
downloadopenttd-808d9255a8e68fa34bdb51eccdd4db4a347268ed.tar.xz
(svn r14559) -Fix [FS#2387]: A train could be blocked inside a depot if it was reversed just after leaving the depot.
Diffstat (limited to 'src')
-rw-r--r--src/train_cmd.cpp4
-rw-r--r--src/vehicle.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 96fd4dd07..43cf9265c 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3654,10 +3654,6 @@ static void TrainController(Vehicle *v, Vehicle *nomove, bool update_image)
TrainEnterStation(v, r >> VETS_STATION_ID_OFFSET);
return;
}
- if (v->Next() == NULL && IsRailDepotTile(v->tile) && HasBit(r, VETS_ENTERED_WORMHOLE)) {
- SetDepotWaypointReservation(v->tile, false);
- if (_settings_client.gui.show_track_reservation) MarkTileDirtyByTile(v->tile);
- }
if (v->current_order.IsType(OT_LEAVESTATION)) {
v->current_order.Free();
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index f69951e89..95986e061 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1558,6 +1558,10 @@ void VehicleEnterDepot(Vehicle *v)
switch (v->type) {
case VEH_TRAIN:
InvalidateWindowClasses(WC_TRAINS_LIST);
+ /* Clear path reservation */
+ SetDepotWaypointReservation(v->tile, false);
+ if (_settings_client.gui.show_track_reservation) MarkTileDirtyByTile(v->tile);
+
if (!IsFrontEngine(v)) v = v->First();
UpdateSignalsOnSegment(v->tile, INVALID_DIAGDIR, v->owner);
v->load_unload_time_rem = 0;