OpenTTD Source 20241224-master-gf74b0cf984
order_cmd.cpp File Reference

Handling of orders. More...

#include "stdafx.h"
#include "debug.h"
#include "command_func.h"
#include "company_func.h"
#include "news_func.h"
#include "strings_func.h"
#include "timetable.h"
#include "vehicle_func.h"
#include "depot_base.h"
#include "core/pool_func.hpp"
#include "core/random_func.hpp"
#include "aircraft.h"
#include "roadveh.h"
#include "station_base.h"
#include "waypoint_base.h"
#include "company_base.h"
#include "order_backup.h"
#include "cheat_type.h"
#include "order_cmd.h"
#include "train_cmd.h"
#include "table/strings.h"
#include "safeguards.h"

Go to the source code of this file.

Functions

void InvalidateVehicleOrder (const Vehicle *v, int data)
 Updates the widgets of a vehicle which contains the order-data.
 
static bool OrderGoesToStation (const Vehicle *v, const Order *o)
 Checks whether the order goes to a station or not, i.e.
 
static void DeleteOrderWarnings (const Vehicle *v)
 Delete all news items regarding defective orders about a vehicle This could kill still valid warnings (for example about void order when just another order gets added), but assume the company will notice the problems, when they're changing the orders.
 
uint GetOrderDistance (const Order *prev, const Order *cur, const Vehicle *v, int conditional_depth)
 Get the distance between two orders of a vehicle.
 
CommandCost CmdInsertOrder (DoCommandFlag flags, VehicleID veh, VehicleOrderID sel_ord, const Order &new_order)
 Add an order to the orderlist of a vehicle.
 
void InsertOrder (Vehicle *v, Order *new_o, VehicleOrderID sel_ord)
 Insert a new order but skip the validation.
 
static CommandCost DecloneOrder (Vehicle *dst, DoCommandFlag flags)
 Declone an order-list.
 
CommandCost CmdDeleteOrder (DoCommandFlag flags, VehicleID veh_id, VehicleOrderID sel_ord)
 Delete an order from the orderlist of a vehicle.
 
static void CancelLoadingDueToDeletedOrder (Vehicle *v)
 Cancel the current loading order of the vehicle as the order was deleted.
 
void DeleteOrder (Vehicle *v, VehicleOrderID sel_ord)
 Delete an order but skip the parameter validation.
 
CommandCost CmdSkipToOrder (DoCommandFlag flags, VehicleID veh_id, VehicleOrderID sel_ord)
 Goto order of order-list.
 
CommandCost CmdMoveOrder (DoCommandFlag flags, VehicleID veh, VehicleOrderID moving_order, VehicleOrderID target_order)
 Move an order inside the orderlist.
 
CommandCost CmdModifyOrder (DoCommandFlag flags, VehicleID veh, VehicleOrderID sel_ord, ModifyOrderFlags mof, uint16_t data)
 Modify an order in the orderlist of a vehicle.
 
static bool CheckAircraftOrderDistance (const Aircraft *v_new, const Vehicle *v_order, const Order *first)
 Check if an aircraft has enough range for an order list.
 
CommandCost CmdCloneOrder (DoCommandFlag flags, CloneOptions action, VehicleID veh_dst, VehicleID veh_src)
 Clone/share/copy an order-list of another vehicle.
 
CommandCost CmdOrderRefit (DoCommandFlag flags, VehicleID veh, VehicleOrderID order_number, CargoID cargo)
 Add/remove refit orders from an order.
 
void CheckOrders (const Vehicle *v)
 Check the orders of a vehicle, to see if there are invalid orders and stuff.
 
void RemoveOrderFromAllVehicles (OrderType type, DestinationID destination, bool hangar)
 Removes an order from all vehicles.
 
void DeleteVehicleOrders (Vehicle *v, bool keep_orderlist, bool reset_order_indices)
 Delete all orders from a vehicle.
 
uint16_t GetServiceIntervalClamped (int interval, bool ispercent)
 Clamp the service interval to the correct min/max.
 
static bool CheckForValidOrders (const Vehicle *v)
 Check if a vehicle has any valid orders.
 
static bool OrderConditionCompare (OrderConditionComparator occ, int variable, int value)
 Compare the variable and value based on the given comparator.
 
template<typename T , std::enable_if_t< std::is_base_of< StrongTypedefBase, T >::value, int > = 0>
static bool OrderConditionCompare (OrderConditionComparator occ, T variable, int value)
 
VehicleOrderID ProcessConditionalOrder (const Order *order, const Vehicle *v)
 Process a conditional order and determine the next order.
 
bool UpdateOrderDest (Vehicle *v, const Order *order, int conditional_depth, bool pbs_look_ahead)
 Update the vehicle's destination tile from an order.
 
bool ProcessOrders (Vehicle *v)
 Handle the orders of a vehicle and determine the next place to go to if needed.
 

Variables

OrderPool _order_pool ("Order")
 
OrderListPool _orderlist_pool ("OrderList")
 

Detailed Description

Handling of orders.

Definition in file order_cmd.cpp.

Function Documentation

◆ CancelLoadingDueToDeletedOrder()

static void CancelLoadingDueToDeletedOrder ( Vehicle v)
static

Cancel the current loading order of the vehicle as the order was deleted.

Parameters
vthe vehicle

Definition at line 1021 of file order_cmd.cpp.

References Vehicle::current_order, Order::GetLoadType(), Order::IsType(), OLF_LOAD_IF_POSSIBLE, OLFB_FULL_LOAD, ONSF_STOP_EVERYWHERE, Order::SetLoadType(), and Order::SetNonStopType().

Referenced by DeleteOrder(), and DeleteVehicleOrders().

◆ CheckAircraftOrderDistance()

static bool CheckAircraftOrderDistance ( const Aircraft v_new,
const Vehicle v_order,
const Order first 
)
static

Check if an aircraft has enough range for an order list.

Parameters
v_newAircraft to check.
v_orderVehicle currently holding the order list.
firstFirst order in the source order list.
Returns
True if the aircraft has enough range for the orders, false otherwise.

Definition at line 1492 of file order_cmd.cpp.

References AircraftCache::cached_max_range, AircraftCache::cached_max_range_sqr, GetOrderDistance(), and Order::next.

Referenced by CmdCloneOrder().

◆ CheckForValidOrders()

static bool CheckForValidOrders ( const Vehicle v)
static

Check if a vehicle has any valid orders.

Returns
false if there are no valid orders
Note
Conditional orders are not considered valid destination orders

Definition at line 1921 of file order_cmd.cpp.

References Vehicle::Orders().

Referenced by ProcessOrders().

◆ CheckOrders()

◆ CmdCloneOrder()

CommandCost CmdCloneOrder ( DoCommandFlag  flags,
CloneOptions  action,
VehicleID  veh_dst,
VehicleID  veh_src 
)

◆ CmdDeleteOrder()

CommandCost CmdDeleteOrder ( DoCommandFlag  flags,
VehicleID  veh_id,
VehicleOrderID  sel_ord 
)

Delete an order from the orderlist of a vehicle.

Parameters
flagsoperation to perform
veh_idthe ID of the vehicle
sel_ordthe order to delete (max 255)
Returns
the cost of this operation or an error

Definition at line 999 of file order_cmd.cpp.

References CheckOwnership(), CMD_ERROR, DC_EXEC, DecloneOrder(), DeleteOrder(), CommandCost::Failed(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), Vehicle::IsPrimaryVehicle(), and Vehicle::owner.

◆ CmdInsertOrder()

CommandCost CmdInsertOrder ( DoCommandFlag  flags,
VehicleID  veh,
VehicleOrderID  sel_ord,
const Order new_order 
)

Add an order to the orderlist of a vehicle.

Parameters
flagsoperation to perform
vehID of the vehicle
sel_ordthe selected order (if any). If the last order is given, the order will be inserted before that one the maximum vehicle order id is 254.
new_orderorder to insert
Returns
the cost of this operation or an error

Definition at line 697 of file order_cmd.cpp.

References Station::airport, Order::AssignOrder(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_order_pool >::CanAllocateItem(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_orderlist_pool >::CanAllocateItem(), CanVehicleUseStation(), CARGO_NO_REFIT, CheckOwnership(), CMD_ERROR, DC_EXEC, FACIL_BUS_STOP, FACIL_DOCK, FACIL_TRAIN, FACIL_TRUCK_STOP, BaseStation::facilities, CommandCost::Failed(), Vehicle::FirstShared(), Order::GetConditionComparator(), Order::GetConditionSkipToOrder(), Order::GetConditionValue(), Order::GetConditionVariable(), Order::GetDepotActionType(), Order::GetDepotOrderType(), Order::GetDestination(), SpecializedStation< Waypoint, true >::GetIfValid(), SpecializedStation< Station, false >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_depot_pool >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Order::GetLoadType(), Order::GetMaxSpeed(), Order::GetNonStopType(), Vehicle::GetNumOrders(), Order::GetRefitCargo(), Order::GetStopLocation(), GetTileOwner(), Order::GetTravelTime(), Order::GetType(), Order::GetUnloadType(), GetVehicleCannotUseStationReason(), Order::GetWaitTime(), Vehicle::HasConditionalOrder(), Vehicle::HasFullLoadOrder(), Airport::HasHangar(), Vehicle::HasUnbunchingOrder(), InsertOrder(), Vehicle::IsGroundVehicle(), Vehicle::IsPrimaryVehicle(), IsRailDepotTile(), IsRoadDepotTile(), IsShipDepotTile(), MAX_VEH_ORDER_ID, OCC_EQUALS, OCC_IS_FALSE, OCC_IS_TRUE, OCV_LOAD_PERCENTAGE, OCV_RELIABILITY, OCV_REQUIRES_SERVICE, OCV_UNCONDITIONALLY, ODATFB_HALT, ODATFB_NEAREST_DEPOT, ODATFB_UNBUNCH, ODTFB_PART_OF_ORDERS, ODTFB_SERVICE, OLF_FULL_LOAD_ANY, OLF_LOAD_IF_POSSIBLE, OLFB_FULL_LOAD, OLFB_NO_LOAD, ONSF_STOP_EVERYWHERE, Vehicle::orders, OSL_PLATFORM_FAR_END, OSL_PLATFORM_MIDDLE, OSL_PLATFORM_NEAR_END, OUF_UNLOAD_IF_POSSIBLE, OUFB_NO_UNLOAD, OUFB_TRANSFER, OUFB_UNLOAD, BaseStation::owner, Vehicle::owner, OWNER_NONE, BaseVehicle::type, VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, and VEH_TRAIN.

◆ CmdModifyOrder()

CommandCost CmdModifyOrder ( DoCommandFlag  flags,
VehicleID  veh,
VehicleOrderID  sel_ord,
ModifyOrderFlags  mof,
uint16_t  data 
)

Modify an order in the orderlist of a vehicle.

Parameters
flagsoperation to perform
vehID of the vehicle
sel_ordthe selected order (if any). If the last order is given, the order will be inserted before that one the maximum vehicle order id is 254.
mofwhat data to modify (
See also
ModifyOrderFlags)
Parameters
datathe data to modify
Returns
the cost of this operation or an error

Definition at line 1237 of file order_cmd.cpp.

References CARGO_NO_REFIT, CheckOwnership(), CMD_ERROR, BaseConsist::cur_real_order_index, Vehicle::current_order, DA_ALWAYS_GO, DA_SERVICE, DA_STOP, DA_UNBUNCH, DC_EXEC, DeleteOrderWarnings(), CommandCost::Failed(), Vehicle::FirstShared(), Order::GetConditionComparator(), Order::GetConditionValue(), Order::GetConditionVariable(), Order::GetDepotActionType(), Order::GetDepotOrderType(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Order::GetLoadType(), Order::GetNonStopType(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), Order::GetType(), Order::GetUnloadType(), Vehicle::HasConditionalOrder(), Vehicle::HasFullLoadOrder(), Vehicle::HasUnbunchingOrder(), InvalidateVehicleOrder(), Vehicle::IsGroundVehicle(), Vehicle::IsPrimaryVehicle(), Order::IsType(), MOF_COND_COMPARATOR, MOF_COND_DESTINATION, MOF_COND_VALUE, MOF_COND_VARIABLE, MOF_DEPOT_ACTION, MOF_LOAD, MOF_NON_STOP, MOF_STOP_LOCATION, MOF_UNLOAD, Vehicle::NextShared(), OCC_EQUALS, OCC_IS_FALSE, OCC_IS_TRUE, OCV_LOAD_PERCENTAGE, OCV_RELIABILITY, OCV_REQUIRES_SERVICE, OCV_UNCONDITIONALLY, ODATFB_HALT, ODATFB_UNBUNCH, ODTFB_SERVICE, OLF_FULL_LOAD_ANY, OLF_LOAD_IF_POSSIBLE, OLFB_FULL_LOAD, OLFB_NO_LOAD, ONSF_NO_STOP_AT_DESTINATION_STATION, OUF_UNLOAD_IF_POSSIBLE, OUFB_NO_UNLOAD, OUFB_TRANSFER, OUFB_UNLOAD, Vehicle::owner, BaseConsist::ResetDepotUnbunching(), Order::SetConditionComparator(), Order::SetConditionSkipToOrder(), Order::SetConditionValue(), Order::SetConditionVariable(), Order::SetDepotActionType(), Order::SetDepotOrderType(), Order::SetLoadType(), Order::SetNonStopType(), Order::SetRefit(), Order::SetStopLocation(), Order::SetUnloadType(), BaseVehicle::type, VEH_TRAIN, and VIWD_MODIFY_ORDERS.

◆ CmdMoveOrder()

CommandCost CmdMoveOrder ( DoCommandFlag  flags,
VehicleID  veh,
VehicleOrderID  moving_order,
VehicleOrderID  target_order 
)

Move an order inside the orderlist.

Parameters
flagsoperation to perform
vehthe ID of the vehicle
moving_orderthe order to move
target_orderthe target order
Returns
the cost of this operation or an error
Note
The target order will move one place down in the orderlist if you move the order upwards else it'll move it one place down

Definition at line 1139 of file order_cmd.cpp.

References CheckOwnership(), CMD_ERROR, BaseConsist::cur_implicit_order_index, BaseConsist::cur_real_order_index, DC_EXEC, DeleteOrderWarnings(), CommandCost::Failed(), Vehicle::FirstShared(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), GetWindowClassForVehicleType(), InvalidateVehicleOrder(), InvalidateWindowClassesData(), Vehicle::IsPrimaryVehicle(), OrderList::MoveOrder(), Vehicle::NextShared(), Vehicle::orders, Vehicle::Orders(), Vehicle::owner, BaseConsist::ResetDepotUnbunching(), and BaseVehicle::type.

◆ CmdOrderRefit()

◆ CmdSkipToOrder()

◆ DecloneOrder()

static CommandCost DecloneOrder ( Vehicle dst,
DoCommandFlag  flags 
)
static

Declone an order-list.

Parameters
*dstdelete the orders of this vehicle
flagsexecution flags

Definition at line 982 of file order_cmd.cpp.

References DC_EXEC, DeleteVehicleOrders(), GetWindowClassForVehicleType(), InvalidateVehicleOrder(), InvalidateWindowClassesData(), BaseVehicle::type, and VIWD_REMOVE_ALL_ORDERS.

Referenced by CmdCloneOrder(), and CmdDeleteOrder().

◆ DeleteOrder()

◆ DeleteOrderWarnings()

static void DeleteOrderWarnings ( const Vehicle v)
static

Delete all news items regarding defective orders about a vehicle This could kill still valid warnings (for example about void order when just another order gets added), but assume the company will notice the problems, when they're changing the orders.

Definition at line 627 of file order_cmd.cpp.

References DeleteVehicleNews(), and Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index.

Referenced by CmdModifyOrder(), CmdMoveOrder(), DeleteOrder(), DeleteVehicleOrders(), and InsertOrder().

◆ DeleteVehicleOrders()

void DeleteVehicleOrders ( Vehicle v,
bool  keep_orderlist,
bool  reset_order_indices 
)

Delete all orders from a vehicle.

Parameters
vVehicle whose orders to reset
keep_orderlistIf true, do not free the order list, only empty it.
reset_order_indicesIf true, reset cur_implicit_order_index and cur_real_order_index and cancel the current full load order (if the vehicle is loading). If false, you have to make sure the order indices are valid after your messing with them!

Definition at line 1869 of file order_cmd.cpp.

References CancelLoadingDueToDeletedOrder(), BaseConsist::cur_implicit_order_index, BaseConsist::cur_real_order_index, Vehicle::current_order, DeleteOrderWarnings(), OrderList::FreeChain(), Vehicle::IsOrderListShared(), Order::IsType(), Vehicle::orders, Vehicle::RemoveFromShared(), and BaseConsist::ResetDepotUnbunching().

Referenced by CmdCloneOrder(), CmdMoveRailVehicle(), CmdSellRailWagon(), DecloneOrder(), and Vehicle::PreDestructor().

◆ GetOrderDistance()

uint GetOrderDistance ( const Order prev,
const Order cur,
const Vehicle v,
int  conditional_depth 
)

Get the distance between two orders of a vehicle.

Conditional orders are resolved and the bigger distance of the two order branches is returned.

Parameters
prevOrigin order.
curDestination order.
vThe vehicle to get the distance for.
conditional_depthInternal param for resolving conditional orders.
Returns
Maximum distance between the two orders.

Definition at line 669 of file order_cmd.cpp.

References DistanceManhattan(), DistanceSquare(), Order::GetConditionSkipToOrder(), OrderList::GetFirstOrder(), Order::GetLocation(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), GetOrderDistance(), INVALID_TILE, Order::IsType(), Order::next, Vehicle::orders, BaseVehicle::type, and VEH_AIRCRAFT.

Referenced by CheckAircraftOrderDistance(), DrawOrderString(), and GetOrderDistance().

◆ GetServiceIntervalClamped()

uint16_t GetServiceIntervalClamped ( int  interval,
bool  ispercent 
)

Clamp the service interval to the correct min/max.

The actual min/max values depend on whether it's in days, minutes, or percent.

Parameters
intervalThe proposed service interval.
ispercentWhether the interval is a percent.
Returns
The service interval clamped to use the chosen units.

Definition at line 1901 of file order_cmd.cpp.

References Clamp(), and TimerGameEconomy::UsingWallclockUnits().

Referenced by CmdChangeServiceInt(), VehicleDetailsWindow::OnClick(), and VehicleDetailsWindow::OnDropdownSelect().

◆ InsertOrder()

◆ InvalidateVehicleOrder()

◆ OrderConditionCompare() [1/2]

static bool OrderConditionCompare ( OrderConditionComparator  occ,
int  variable,
int  value 
)
static

Compare the variable and value based on the given comparator.

Definition at line 1941 of file order_cmd.cpp.

References OCC_EQUALS, OCC_IS_FALSE, OCC_IS_TRUE, OCC_LESS_EQUALS, OCC_LESS_THAN, OCC_MORE_EQUALS, OCC_MORE_THAN, and OCC_NOT_EQUALS.

Referenced by ProcessConditionalOrder().

◆ OrderConditionCompare() [2/2]

template<typename T , std::enable_if_t< std::is_base_of< StrongTypedefBase, T >::value, int > = 0>
static bool OrderConditionCompare ( OrderConditionComparator  occ,
variable,
int  value 
)
static

Definition at line 1957 of file order_cmd.cpp.

◆ OrderGoesToStation()

static bool OrderGoesToStation ( const Vehicle v,
const Order o 
)
inlinestatic

Checks whether the order goes to a station or not, i.e.

whether the destination is a station

Parameters
vthe vehicle to check for
othe order to check
Returns
true if the destination is a station

Definition at line 615 of file order_cmd.cpp.

References Order::GetDestination(), Order::IsType(), BaseVehicle::type, and VEH_AIRCRAFT.

Referenced by CmdCloneOrder().

◆ ProcessConditionalOrder()

◆ ProcessOrders()

bool ProcessOrders ( Vehicle v)

Handle the orders of a vehicle and determine the next place to go to if needed.

Parameters
vthe vehicle to do this for.
Returns
true if the vehicle is eligible for reversing (basically only when leaving a station).

Reversing because of order change is allowed only just after leaving a station (and the difficulty setting to allowed, of course) this can be detected because only after OT_LEAVESTATION, current_order will be reset to nothing. (That also happens if no order, but in that case it won't hit the point in code where may_reverse is checked)

Definition at line 2127 of file order_cmd.cpp.

References CheckForValidOrders(), BaseConsist::cur_implicit_order_index, BaseConsist::cur_real_order_index, Vehicle::current_order, Vehicle::DeleteUnreachedImplicitOrders(), Vehicle::dest_tile, Order::Equals(), Order::Free(), SpecializedVehicle< Aircraft, VEH_AIRCRAFT >::From(), SpecializedStation< Station, false >::Get(), Order::GetDepotOrderType(), Order::GetDestination(), Order::GetNonStopType(), Vehicle::GetNumManualOrders(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), GetStationIndex(), Order::GetType(), GetWindowClassForVehicleType(), Vehicle::IncrementImplicitOrderIndex(), INVALID_TILE, InvalidateVehicleOrder(), IsTileType(), Order::IsType(), Vehicle::last_station_visited, MP_STATION, ODTFB_PART_OF_ORDERS, ONSF_NO_STOP_AT_DESTINATION_STATION, SetWindowClassesDirty(), Station::ship_station, OrthogonalTileArea::tile, Vehicle::tile, BaseVehicle::type, UpdateOrderDest(), Vehicle::UpdateRealOrderIndex(), UpdateVehicleTimetable(), VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, VEH_TRAIN, and VIWD_MODIFY_ORDERS.

Referenced by CheckNextTrainTile().

◆ RemoveOrderFromAllVehicles()

void RemoveOrderFromAllVehicles ( OrderType  type,
DestinationID  destination,
bool  hangar 
)

Removes an order from all vehicles.

Triggers when, say, a station is removed.

Parameters
typeThe type of the order (OT_GOTO_[STATION|DEPOT|WAYPOINT]).
destinationThe destination. Can be a StationID, DepotID or WaypointID.
hangarOnly used for airports in the destination. When false, remove airport and hangar orders. When true, remove either airport or hangar order.

Definition at line 1787 of file order_cmd.cpp.

References DeleteOrder(), Vehicle::FirstShared(), INVALID_VEH_ORDER_ID, InvalidateVehicleOrder(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::Iterate(), ODATFB_NEAREST_DEPOT, OrderBackup::RemoveOrder(), SetWindowDirty(), VEH_AIRCRAFT, and WC_VEHICLE_VIEW.

Referenced by UpdateAirplanesOnNewStation(), Depot::~Depot(), and Station::~Station().

◆ UpdateOrderDest()

bool UpdateOrderDest ( Vehicle v,
const Order order,
int  conditional_depth,
bool  pbs_look_ahead 
)

Update the vehicle's destination tile from an order.

Parameters
orderthe order the vehicle currently has
vthe vehicle to update
conditional_depththe depth (amount of steps) to go with conditional orders. This to prevent infinite loops.
pbs_look_aheadWhether we are forecasting orders for pbs reservations in advance. If true, the order indices must not be modified.

Definition at line 1998 of file order_cmd.cpp.

References AircraftNextAirportPos_and_Order(), BaseConsist::cur_implicit_order_index, BaseConsist::cur_real_order_index, Vehicle::current_order, BaseConsist::current_order_time, TimerGameEconomy::date_fract, Ticks::DAY_TICKS, DC_EXEC, Vehicle::dest_tile, ClosestDepot::destination, Vehicle::FindClosestDepot(), FLYING, Order::Free(), SpecializedVehicle< Aircraft, VEH_AIRCRAFT >::From(), SpecializedStation< Waypoint, true >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_depot_pool >::Get(), Order::GetDepotActionType(), Order::GetDepotOrderType(), Order::GetDestination(), Vehicle::GetGroundVehicleFlags(), Vehicle::GetNumManualOrders(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), Vehicle::GetOrderStationLocation(), Aircraft::GetOrderStationLocation(), Order::GetTimetabledTravel(), Order::GetType(), GVF_SUPPRESS_IMPLICIT_ORDERS, Vehicle::IncrementRealOrderIndex(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_VEH_ORDER_ID, Vehicle::IsGroundVehicle(), Order::IsType(), Vehicle::NeedsServicing(), ODATFB_NEAREST_DEPOT, ODTFB_SERVICE, ProcessConditionalOrder(), SetBit(), Order::SetDestination(), Aircraft::state, Aircraft::targetairport, BaseVehicle::type, UpdateOrderDest(), Vehicle::UpdateRealOrderIndex(), UpdateVehicleTimetable(), VEH_AIRCRAFT, VEH_TRAIN, and BaseStation::xy.

Referenced by ProcessOrders(), VehicleOrderSaver::SwitchToNextOrder(), and UpdateOrderDest().