diff options
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r-- | src/order_cmd.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 62bf9bed4..c84026fa4 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -398,7 +398,7 @@ static uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle conditional_depth++; - int dist1 = GetOrderDistance(prev, GetVehicleOrder(v, cur->GetConditionSkipToOrder()), v, conditional_depth); + int dist1 = GetOrderDistance(prev, v->GetOrder(cur->GetConditionSkipToOrder()), v, conditional_depth); int dist2 = GetOrderDistance(prev, cur->next == NULL ? v->orders.list->GetFirstOrder() : cur->next, v, conditional_depth); return max(dist1, dist2); } @@ -668,7 +668,7 @@ CommandCost CmdDeleteOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (sel_ord >= v->GetNumOrders()) return DecloneOrder(v, flags); - order = GetVehicleOrder(v, sel_ord); + order = v->GetOrder(sel_ord); if (order == NULL) return CMD_ERROR; if (flags & DC_EXEC) { @@ -772,7 +772,7 @@ CommandCost CmdMoveOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 moving_order == target_order || v->GetNumOrders() <= 1) return CMD_ERROR; - Order *moving_one = GetVehicleOrder(v, moving_order); + Order *moving_one = v->GetOrder(moving_order); /* Don't move an empty order */ if (moving_one == NULL) return CMD_ERROR; @@ -849,7 +849,7 @@ CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /* Is it a valid order? */ if (sel_ord >= v->GetNumOrders()) return CMD_ERROR; - Order *order = GetVehicleOrder(v, sel_ord); + Order *order = v->GetOrder(sel_ord); switch (order->GetType()) { case OT_GOTO_STATION: if (mof == MOF_COND_VARIABLE || mof == MOF_COND_COMPARATOR || mof == MOF_DEPOT_ACTION || mof == MOF_COND_VALUE || Station::Get(order->GetDestination())->IsBuoy()) return CMD_ERROR; @@ -1191,7 +1191,7 @@ CommandCost CmdOrderRefit(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 const Vehicle *v = Vehicle::GetIfValid(veh); if (v == NULL || !CheckOwnership(v->owner)) return CMD_ERROR; - Order *order = GetVehicleOrder(v, order_number); + Order *order = v->GetOrder(order_number); if (order == NULL) return CMD_ERROR; if (flags & DC_EXEC) { @@ -1412,7 +1412,7 @@ void CheckOrders(const Vehicle *v) /* Check if the last and the first order are the same */ if (v->GetNumOrders() > 1) { - const Order *last = GetLastVehicleOrder(v); + const Order *last = v->GetLastOrder(); if (v->orders.list->GetFirstOrder()->Equals(*last)) { problem_type = 2; @@ -1648,7 +1648,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth) if (next_order != INVALID_VEH_ORDER_ID) { UpdateVehicleTimetable(v, false); v->cur_order_index = next_order; - v->current_order_time += GetVehicleOrder(v, next_order)->travel_time; + v->current_order_time += v->GetOrder(next_order)->travel_time; } else { UpdateVehicleTimetable(v, true); v->IncrementOrderIndex(); @@ -1657,7 +1657,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth) assert(v->cur_order_index < v->GetNumOrders()); /* Get the current order */ - const Order *order = GetVehicleOrder(v, v->cur_order_index); + const Order *order = v->GetOrder(v->cur_order_index); v->current_order = *order; return UpdateOrderDest(v, order, conditional_depth + 1); } @@ -1726,7 +1726,7 @@ bool ProcessOrders(Vehicle *v) /* Get the current order */ if (v->cur_order_index >= v->GetNumOrders()) v->cur_order_index = 0; - const Order *order = GetVehicleOrder(v, v->cur_order_index); + const Order *order = v->GetOrder(v->cur_order_index); /* If no order, do nothing. */ if (order == NULL || (v->type == VEH_AIRCRAFT && order->IsType(OT_DUMMY) && !CheckForValidOrders(v))) { |