summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-05-06 12:48:13 +0000
committeryexo <yexo@openttd.org>2009-05-06 12:48:13 +0000
commitfe5defbaccb401f94662513c30fbf372b6944153 (patch)
treeb49640ebac5376560c61b51a792b22d3b1774349 /src/ai/api
parent951b9e76153380e97cadab2c6a0ac3454539bb6f (diff)
downloadopenttd-fe5defbaccb401f94662513c30fbf372b6944153.tar.xz
(svn r16239) -Fix (r16199): Use the stop/non-stop intermediate orderflags AIs can give for goto-depot orders
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_order.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp
index 20733c4f9..cdff05c06 100644
--- a/src/ai/api/ai_order.cpp
+++ b/src/ai/api/ai_order.cpp
@@ -336,14 +336,15 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
case OT_GOTO_DEPOT: {
OrderDepotTypeFlags odtf = (OrderDepotTypeFlags)(ODTFB_PART_OF_ORDERS | ((order_flags & AIOF_SERVICE_IF_NEEDED) ? ODTFB_SERVICE : 0));
OrderDepotActionFlags odaf = (OrderDepotActionFlags)(ODATF_SERVICE_ONLY | ((order_flags & AIOF_STOP_IN_DEPOT) ? ODATFB_HALT : 0));
+ OrderNonStopFlags onsf = (OrderNonStopFlags)((order_flags & AIOF_NON_STOP_INTERMEDIATE) ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE);
/* Check explicitly if the order is to a station (for aircraft) or
* to a depot (other vehicle types). */
if (::GetVehicle(vehicle_id)->type == VEH_AIRCRAFT) {
if (!::IsTileType(destination, MP_STATION)) return false;
- order.MakeGoToDepot(::GetStationIndex(destination), odtf, ONSF_STOP_EVERYWHERE, odaf);
+ order.MakeGoToDepot(::GetStationIndex(destination), odtf, onsf, odaf);
} else {
if (::IsTileType(destination, MP_STATION)) return false;
- order.MakeGoToDepot(::GetDepotByTile(destination)->index, odtf, ONSF_STOP_EVERYWHERE, odaf);
+ order.MakeGoToDepot(::GetDepotByTile(destination)->index, odtf, onsf, odaf);
}
break;
}