summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-01-21 19:31:25 +0000
committeryexo <yexo@openttd.org>2010-01-21 19:31:25 +0000
commitb76a5669f5b3ccba7ad3e8822d57b33533bf5dce (patch)
tree4977a9b5af5b6aef8b80baef1033b1d42ef46db1
parentfdfd0ab922284bd75de989ca1a5dec200c7d0e27 (diff)
downloadopenttd-b76a5669f5b3ccba7ad3e8822d57b33533bf5dce.tar.xz
(svn r18880) -Fix: aircraft can be send to an hangar when the target airport has one and when it can land, not only when it has a plane terminal
-rw-r--r--src/aircraft_cmd.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index b20d1df3e..812187f2e 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -531,10 +531,8 @@ static void CheckIfAircraftNeedsService(Aircraft *v)
assert(st != NULL);
- /* only goto depot if the target airport has terminals (eg. it is airport) */
- if (st->airport_tile != INVALID_TILE && st->Airport()->terminals != NULL) {
-// printf("targetairport = %d, st->index = %d\n", v->targetairport, st->index);
-// v->targetairport = st->index;
+ /* only goto depot if the target airport has a depot */
+ if (st->GetAirportSpec()->nof_depots > 0 && CanVehicleUseStation(v, st)) {
v->current_order.MakeGoToDepot(st->index, ODTFB_SERVICE);
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
} else if (v->current_order.IsType(OT_GOTO_DEPOT)) {