mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-20 04:59:11 +00:00
Change: Add path cache for ships.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user