diff options
author | frosch <frosch@openttd.org> | 2011-04-10 10:47:21 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-04-10 10:47:21 +0000 |
commit | 5bf90860f8af2c648c2704f29e1c9ac28deddd55 (patch) | |
tree | 4dd6a62700c30a7956213bc231e10814a63e9c61 /src/roadveh_cmd.cpp | |
parent | d1a50a01b46684486428a2b63959cb160a016c39 (diff) | |
download | openttd-5bf90860f8af2c648c2704f29e1c9ac28deddd55.tar.xz |
(svn r22309) -Fix: Make road vehicles, ships and aircraft skip orders if they are leaving a depot and heading to the same one again; just like trains since r16322.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 69c1a555d..5ef0946c5 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -941,6 +941,12 @@ static bool RoadVehLeaveDepot(RoadVehicle *v, bool first) int y = TileY(v->tile) * TILE_SIZE + (rdp[RVC_DEPOT_START_FRAME].y & 0xF); if (first) { + /* We are leaving a depot, but have to go to the exact same one; re-enter */ + if (v->current_order.IsType(OT_GOTO_DEPOT) && v->tile == v->dest_tile) { + VehicleEnterDepot(v); + return true; + } + if (RoadVehFindCloseTo(v, x, y, v->direction, false) != NULL) return true; VehicleServiceInDepot(v); |