summaryrefslogtreecommitdiff
path: root/src/order_cmd.cpp
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2019-01-14 23:33:42 +0000
committerPeterN <peter@fuzzle.org>2019-01-19 23:11:17 +0000
commit81330b8d6edee68c38717462737fbfca6420701d (patch)
treeed4e0e34930a5e6f28b5d275c27f6ccb50a2ba63 /src/order_cmd.cpp
parent1c725fce47d60907bbf2224c7bdc28607fcf6017 (diff)
downloadopenttd-81330b8d6edee68c38717462737fbfca6420701d.tar.xz
Change: Add path cache for ships.
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r--src/order_cmd.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 093e4b9b5..d9d741dbc 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -2041,13 +2041,13 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
{
if (conditional_depth > v->GetNumOrders()) {
v->current_order.Free();
- v->dest_tile = 0;
+ v->SetDestTile(0);
return false;
}
switch (order->GetType()) {
case OT_GOTO_STATION:
- v->dest_tile = v->GetOrderStationLocation(order->GetDestination());
+ v->SetDestTile(v->GetOrderStationLocation(order->GetDestination()));
return true;
case OT_GOTO_DEPOT:
@@ -2068,7 +2068,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
/* PBS reservations cannot reverse */
if (pbs_look_ahead && reverse) return false;
- v->dest_tile = location;
+ v->SetDestTile(location);
v->current_order.MakeGoToDepot(destination, v->current_order.GetDepotOrderType(), v->current_order.GetNonStopType(), (OrderDepotActionFlags)(v->current_order.GetDepotActionType() & ~ODATFB_NEAREST_DEPOT), v->current_order.GetRefitCargo());
/* If there is no depot in front, reverse automatically (trains only) */
@@ -2092,14 +2092,14 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
v->IncrementRealOrderIndex();
} else {
if (v->type != VEH_AIRCRAFT) {
- v->dest_tile = Depot::Get(order->GetDestination())->xy;
+ v->SetDestTile(Depot::Get(order->GetDestination())->xy);
}
return true;
}
break;
case OT_GOTO_WAYPOINT:
- v->dest_tile = Waypoint::Get(order->GetDestination())->xy;
+ v->SetDestTile(Waypoint::Get(order->GetDestination())->xy);
return true;
case OT_CONDITIONAL: {
@@ -2127,7 +2127,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
}
default:
- v->dest_tile = 0;
+ v->SetDestTile(0);
return false;
}
@@ -2143,7 +2143,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
if (order == NULL) {
v->current_order.Free();
- v->dest_tile = 0;
+ v->SetDestTile(0);
return false;
}
@@ -2219,7 +2219,7 @@ bool ProcessOrders(Vehicle *v)
}
v->current_order.Free();
- v->dest_tile = 0;
+ v->SetDestTile(0);
return false;
}