(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.

This commit is contained in:
frosch
2011-04-10 10:47:21 +00:00
parent d1a50a01b4
commit 5bf90860f8
3 changed files with 25 additions and 4 deletions

View File

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