Handling of orders. More...
#include "stdafx.h"
#include "debug.h"
#include "cmd_helper.h"
#include "command_func.h"
#include "company_func.h"
#include "news_func.h"
#include "vehicle_gui.h"
#include "strings_func.h"
#include "functions.h"
#include "window_func.h"
#include "timetable.h"
#include "vehicle_func.h"
#include "depot_base.h"
#include "core/pool_func.hpp"
#include "aircraft.h"
#include "roadveh.h"
#include "station_base.h"
#include "waypoint_base.h"
#include "company_base.h"
#include "table/strings.h"
Go to the source code of this file.
Functions | |
assert_compile (sizeof(DestinationID) >=sizeof(DepotID)) | |
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 (s)he's changing the orders. | |
static uint | GetOrderDistance (const Order *prev, const Order *cur, const Vehicle *v, int conditional_depth=0) |
CommandCost | CmdInsertOrder (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) |
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 (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) |
Delete an order from the orderlist of a vehicle. | |
void | DeleteOrder (Vehicle *v, VehicleOrderID sel_ord) |
Delete an order but skip the parameter validation. | |
CommandCost | CmdSkipToOrder (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) |
Goto order of order-list. | |
CommandCost | CmdMoveOrder (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) |
Move an order inside the orderlist. | |
CommandCost | CmdModifyOrder (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) |
Modify an order in the orderlist of a vehicle. | |
CommandCost | CmdCloneOrder (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) |
Clone/share/copy an order-list of another vehicle. | |
CommandCost | CmdOrderRefit (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) |
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) |
Removes an order from all vehicles. | |
void | DeleteVehicleOrders (Vehicle *v, bool keep_orderlist) |
Delete all orders from a vehicle. | |
uint16 | GetServiceIntervalClamped (uint interval, CompanyID company_id) |
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. | |
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) |
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. | |
void | InitializeOrders () |
Variables | |
OrderPool | _order_pool ("Order") |
OrderListPool | _orderlist_pool ("OrderList") |
Handling of orders.
Definition in file order_cmd.cpp.
static bool CheckForValidOrders | ( | const Vehicle * | v | ) | [static] |
Check if a vehicle has any valid orders.
Definition at line 1539 of file order_cmd.cpp.
References Order::GetType().
Referenced by ProcessOrders().
void CheckOrders | ( | const Vehicle * | v | ) |
Check the orders of a vehicle, to see if there are invalid orders and stuff.
Definition at line 1369 of file order_cmd.cpp.
References _local_company, _settings_client, AddVehicleNewsItem(), CanVehicleUseStation(), Vehicle::day_counter, OrderList::DebugCheckSanity(), Order::Equals(), Vehicle::FirstShared(), SpecializedStation< Station, false >::Get(), Order::GetDestination(), OrderList::GetFirstOrder(), Vehicle::GetLastOrder(), Vehicle::GetNumOrders(), ClientSettings::gui, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, Order::IsType(), Vehicle::list, NS_ADVICE, GUISettings::order_review_system, Vehicle::owner, SetDParam(), Vehicle::vehstatus, VS_CRASHED, and VS_STOPPED.
Referenced by Train::OnNewDay(), Ship::OnNewDay(), RoadVehicle::OnNewDay(), and Aircraft::OnNewDay().
CommandCost CmdCloneOrder | ( | TileIndex | tile, | |
DoCommandFlag | flags, | |||
uint32 | p1, | |||
uint32 | p2, | |||
const char * | text | |||
) |
Clone/share/copy an order-list of another vehicle.
tile | unused | |
flags | operation to perform | |
p1 | various bitstuffed elements
| |
p2 | source vehicle to clone orders from, if any (none for CO_UNSHARE) | |
text | unused |
Definition at line 1198 of file order_cmd.cpp.
References Vehicle::AddToShared(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_orderlist_pool >::CanAllocateItem(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_order_pool >::CanAllocateItem(), CanVehicleUseStation(), CheckOwnership(), CMD_ERROR, DC_EXEC, DecloneOrder(), DeleteVehicleOrders(), CommandCost::Failed(), Vehicle::FirstShared(), SpecializedVehicle< RoadVehicle, Type >::From(), GB(), SpecializedStation< Station, false >::Get(), Order::GetDestination(), OrderList::GetFirstOrder(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetNumOrders(), GetWindowClassForVehicleType(), InvalidateVehicleOrder(), InvalidateWindowClassesData(), RoadVehicle::IsBus(), Vehicle::IsOrderListShared(), Vehicle::IsPrimaryVehicle(), OrderList::IsShared(), Vehicle::list, Order::next, OrderGoesToStation(), Vehicle::owner, return_cmd_error, BaseVehicle::type, and VEH_ROAD.
CommandCost CmdDeleteOrder | ( | TileIndex | tile, | |
DoCommandFlag | flags, | |||
uint32 | p1, | |||
uint32 | p2, | |||
const char * | text | |||
) |
Delete an order from the orderlist of a vehicle.
tile | unused | |
flags | operation to perform | |
p1 | the ID of the vehicle | |
p2 | the order to delete (max 255) | |
text | unused |
Definition at line 766 of file order_cmd.cpp.
References CheckOwnership(), CMD_ERROR, DC_EXEC, DecloneOrder(), DeleteOrder(), CommandCost::Failed(), GB(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), Vehicle::IsPrimaryVehicle(), and Vehicle::owner.
CommandCost CmdInsertOrder | ( | TileIndex | tile, | |
DoCommandFlag | flags, | |||
uint32 | p1, | |||
uint32 | p2, | |||
const char * | text | |||
) |
Add an order to the orderlist of a vehicle.
tile | unused | |
flags | operation to perform | |
p1 | various bitstuffed elements
| |
p2 | packed order to insert | |
text | unused |
Definition at line 476 of file order_cmd.cpp.
References _settings_game, Station::airport, Order::AssignOrder(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_orderlist_pool >::CanAllocateItem(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_order_pool >::CanAllocateItem(), CanVehicleUseStation(), CheckOwnership(), CMD_ERROR, DC_EXEC, FACIL_DOCK, FACIL_TRAIN, BaseStation::facilities, CommandCost::Failed(), Vehicle::FirstShared(), GB(), Order::GetConditionComparator(), Order::GetConditionSkipToOrder(), Order::GetConditionValue(), Order::GetConditionVariable(), Order::GetDepotActionType(), Order::GetDepotOrderType(), Order::GetDestination(), SpecializedStation< Waypoint, true >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_depot_pool >::GetIfValid(), SpecializedStation< Station, false >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Order::GetLoadType(), Order::GetNonStopType(), Vehicle::GetNumOrders(), Order::GetStopLocation(), GetTileOwner(), Order::GetType(), Order::GetUnloadType(), Airport::HasHangar(), InsertOrder(), Vehicle::IsGroundVehicle(), Vehicle::IsPrimaryVehicle(), IsRailDepotTile(), IsRoadDepotTile(), IsShipDepotTile(), Vehicle::list, MAX_VEH_ORDER_ID, Vehicle::NextShared(), OCC_EQUALS, OCC_IS_FALSE, OCC_IS_TRUE, OCV_LOAD_PERCENTAGE, OCV_RELIABILITY, OCV_REQUIRES_SERVICE, OCV_UNCONDITIONALLY, ODATFB_HALT, ODATFB_NEAREST_DEPOT, ODTFB_PART_OF_ORDERS, ODTFB_SERVICE, OLF_FULL_LOAD_ANY, OLF_LOAD_IF_POSSIBLE, OLFB_FULL_LOAD, OLFB_NO_LOAD, ONSF_STOP_EVERYWHERE, 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, PathfinderSettings::pathfinder_for_ships, GameSettings::pf, return_cmd_error, BaseVehicle::type, VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, VEH_TRAIN, and VPF_NPF.
CommandCost CmdModifyOrder | ( | TileIndex | tile, | |
DoCommandFlag | flags, | |||
uint32 | p1, | |||
uint32 | p2, | |||
const char * | text | |||
) |
Modify an order in the orderlist of a vehicle.
tile | unused | |
flags | operation to perform | |
p1 | various bitstuffed elements
| |
p2 | various bitstuffed elements
|
text | unused |
Definition at line 965 of file order_cmd.cpp.
References CheckOwnership(), CMD_ERROR, Vehicle::cur_order_index, Vehicle::current_order, DA_ALWAYS_GO, DA_SERVICE, DA_STOP, DC_EXEC, DeleteOrderWarnings(), CommandCost::Failed(), Vehicle::FirstShared(), GB(), Order::GetConditionComparator(), Order::GetConditionValue(), Order::GetConditionVariable(), Order::GetDepotActionType(), Order::GetDepotOrderType(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Order::GetLoadType(), Order::GetNonStopType(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), Order::GetType(), Order::GetUnloadType(), 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, ODTFB_SERVICE, OLFB_NO_LOAD, OUFB_NO_UNLOAD, OUFB_TRANSFER, OUFB_UNLOAD, Vehicle::owner, Order::SetConditionComparator(), Order::SetConditionSkipToOrder(), Order::SetConditionValue(), Order::SetConditionVariable(), Order::SetDepotActionType(), Order::SetDepotOrderType(), Order::SetLoadType(), Order::SetNonStopType(), Order::SetStopLocation(), Order::SetUnloadType(), BaseVehicle::type, and VEH_TRAIN.
CommandCost CmdMoveOrder | ( | TileIndex | tile, | |
DoCommandFlag | flags, | |||
uint32 | p1, | |||
uint32 | p2, | |||
const char * | text | |||
) |
Move an order inside the orderlist.
tile | unused | |
flags | operation to perform | |
p1 | the ID of the vehicle | |
p2 | order to move and target bit 0-15 : the order to move bit 16-31 : the target order | |
text | unused |
Definition at line 884 of file order_cmd.cpp.
References CheckOwnership(), CMD_ERROR, Vehicle::cur_order_index, DC_EXEC, DeleteOrderWarnings(), CommandCost::Failed(), Vehicle::FirstShared(), GB(), Order::GetConditionSkipToOrder(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), GetWindowClassForVehicleType(), InvalidateVehicleOrder(), InvalidateWindowClassesData(), Vehicle::IsPrimaryVehicle(), Order::IsType(), Vehicle::list, OrderList::MoveOrder(), Vehicle::NextShared(), Vehicle::owner, Order::SetConditionSkipToOrder(), and BaseVehicle::type.
CommandCost CmdOrderRefit | ( | TileIndex | tile, | |
DoCommandFlag | flags, | |||
uint32 | p1, | |||
uint32 | p2, | |||
const char * | text | |||
) |
Add/remove refit orders from an order.
tile | Not used | |
flags | operation to perform | |
p1 | VehicleIndex of the vehicle having the order | |
p2 | bitmask
| |
text | unused |
Definition at line 1328 of file order_cmd.cpp.
References CheckOwnership(), CMD_ERROR, DC_EXEC, CommandCost::Failed(), Vehicle::FirstShared(), GB(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetOrder(), InvalidateVehicleOrder(), Vehicle::IsPrimaryVehicle(), Vehicle::NextShared(), NUM_CARGO, ODTFB_PART_OF_ORDERS, Vehicle::owner, and Order::SetRefit().
CommandCost CmdSkipToOrder | ( | TileIndex | tile, | |
DoCommandFlag | flags, | |||
uint32 | p1, | |||
uint32 | p2, | |||
const char * | text | |||
) |
Goto order of order-list.
tile | unused | |
flags | operation to perform | |
p1 | The ID of the vehicle which order is skipped | |
p2 | the selected order to which we want to skip | |
text | unused |
Definition at line 844 of file order_cmd.cpp.
References CheckOwnership(), CMD_ERROR, Vehicle::cur_order_index, Vehicle::current_order, DC_EXEC, CommandCost::Failed(), GB(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetNumOrders(), InvalidateVehicleOrder(), Vehicle::IsPrimaryVehicle(), Order::IsType(), Vehicle::owner, SetWindowClassesDirty(), BaseVehicle::type, VEH_AIRCRAFT, and VEH_SHIP.
static CommandCost DecloneOrder | ( | Vehicle * | dst, | |
DoCommandFlag | flags | |||
) | [static] |
Declone an order-list.
*dst | delete the orders of this vehicle | |
flags | execution flags |
Definition at line 747 of file order_cmd.cpp.
References DC_EXEC, DeleteVehicleOrders(), GetWindowClassForVehicleType(), InvalidateVehicleOrder(), InvalidateWindowClassesData(), and BaseVehicle::type.
Referenced by CmdCloneOrder(), and CmdDeleteOrder().
void DeleteOrder | ( | Vehicle * | v, | |
VehicleOrderID | sel_ord | |||
) |
Delete an order but skip the parameter validation.
v | The vehicle to delete the order from. | |
sel_ord | The id of the order to be deleted. |
Definition at line 792 of file order_cmd.cpp.
References Vehicle::cur_order_index, Vehicle::current_order, OrderList::DeleteOrderAt(), DeleteOrderWarnings(), Vehicle::FirstShared(), Order::GetConditionSkipToOrder(), Order::GetLoadType(), Vehicle::GetNumOrders(), GetWindowClassForVehicleType(), INVALID_VEH_ORDER_ID, InvalidateVehicleOrder(), InvalidateWindowClassesData(), Order::IsType(), Vehicle::list, max(), Vehicle::NextShared(), OLF_LOAD_IF_POSSIBLE, OLFB_FULL_LOAD, ONSF_STOP_EVERYWHERE, Order::SetConditionSkipToOrder(), Order::SetLoadType(), Order::SetNonStopType(), and BaseVehicle::type.
Referenced by CmdDeleteOrder(), and RemoveOrderFromAllVehicles().
void DeleteVehicleOrders | ( | Vehicle * | v, | |
bool | keep_orderlist | |||
) |
Delete all orders from a vehicle.
Definition at line 1511 of file order_cmd.cpp.
References DeleteOrderWarnings(), OrderList::FreeChain(), Vehicle::IsOrderListShared(), Vehicle::list, and Vehicle::RemoveFromShared().
Referenced by CmdCloneOrder(), CmdMoveRailVehicle(), CmdSellRailWagon(), DecloneOrder(), and Vehicle::PreDestructor().
uint16 GetServiceIntervalClamped | ( | uint | interval, | |
CompanyID | company_id | |||
) |
Clamp the service interval to the correct min/max.
The actual min/max values depend on whether it's in percent or days.
interval | proposed service interval | |
company_id | the owner of the vehicle |
Definition at line 1526 of file order_cmd.cpp.
References Clamp(), and Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::Get().
Referenced by CmdChangeServiceInt(), and VehicleDetailsWindow::OnClick().
void InsertOrder | ( | Vehicle * | v, | |
Order * | new_o, | |||
VehicleOrderID | sel_ord | |||
) |
Insert a new order but skip the validation.
v | The vehicle to insert the order to. | |
new_o | The new order. | |
sel_ord | The position the order should be inserted at. |
Definition at line 695 of file order_cmd.cpp.
References Vehicle::cur_order_index, DeleteOrderWarnings(), Vehicle::FirstShared(), Order::GetConditionSkipToOrder(), Vehicle::GetNumOrders(), GetWindowClassForVehicleType(), OrderList::InsertOrderAt(), INVALID_VEH_ORDER_ID, InvalidateVehicleOrder(), InvalidateWindowClassesData(), Order::IsType(), Vehicle::list, Vehicle::NextShared(), Order::SetConditionSkipToOrder(), and BaseVehicle::type.
Referenced by CmdInsertOrder().
void InvalidateVehicleOrder | ( | const Vehicle * | v, | |
int | data | |||
) |
Updates the widgets of a vehicle which contains the order-data.
Definition at line 175 of file order_cmd.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, InvalidateWindowData(), and SetWindowDirty().
Referenced by CmdCloneOrder(), CmdModifyOrder(), CmdMoveOrder(), CmdOrderRefit(), CmdSkipToOrder(), DecloneOrder(), DeleteOrder(), Vehicle::IncrementOrderIndex(), InsertOrder(), ProcessOrders(), Vehicle::RemoveFromShared(), and RemoveOrderFromAllVehicles().
Checks whether the order goes to a station or not, i.e.
whether the destination is a station
v | the vehicle to check for | |
o | the order to check |
Definition at line 402 of file order_cmd.cpp.
References Order::GetDepotActionType(), Order::IsType(), ODATFB_NEAREST_DEPOT, BaseVehicle::type, and VEH_AIRCRAFT.
Referenced by CmdCloneOrder().
VehicleOrderID ProcessConditionalOrder | ( | const Order * | order, | |
const Vehicle * | v | |||
) |
Process a conditional order and determine the next order.
order | the order the vehicle currently has | |
v | the vehicle to update |
Definition at line 1582 of file order_cmd.cpp.
References Vehicle::age, CalcPercentVehicleFilled(), DAYS_IN_LEAP_YEAR, Order::GetConditionComparator(), Order::GetConditionSkipToOrder(), Order::GetConditionValue(), Order::GetConditionVariable(), Vehicle::GetDisplayMaxSpeed(), Order::GetType(), INVALID_VEH_ORDER_ID, Vehicle::NeedsServicing(), OCV_AGE, OCV_LOAD_PERCENTAGE, OCV_MAX_SPEED, OCV_RELIABILITY, OCV_REQUIRES_SERVICE, OCV_UNCONDITIONALLY, OrderConditionCompare(), Vehicle::reliability, and ToPercent16().
Referenced by VehicleOrderSaver::SwitchToNextOrder(), and UpdateOrderDest().
bool ProcessOrders | ( | Vehicle * | v | ) |
Handle the orders of a vehicle and determine the next place to go to if needed.
v | the vehicle to do this for. |
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 1704 of file order_cmd.cpp.
References CheckForValidOrders(), Vehicle::cur_order_index, Vehicle::current_order, Vehicle::dest_tile, Order::Free(), SpecializedVehicle< Aircraft, VEH_AIRCRAFT >::From(), SpecializedStation< Station, false >::Get(), Order::GetDepotOrderType(), Order::GetDestination(), Vehicle::GetNextManualOrder(), Order::GetNonStopType(), Vehicle::GetNumOrders(), GetStationIndex(), Order::GetType(), GetWindowClassForVehicleType(), Vehicle::IncrementOrderIndex(), INVALID_TILE, InvalidateVehicleOrder(), IsTileType(), Order::IsType(), MP_STATION, ODTFB_PART_OF_ORDERS, ONSF_NO_STOP_AT_DESTINATION_STATION, SetWindowClassesDirty(), Vehicle::tile, BaseVehicle::type, UpdateOrderDest(), VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, and VEH_TRAIN.
Referenced by CheckNextTrainTile().
void RemoveOrderFromAllVehicles | ( | OrderType | type, | |
DestinationID | destination | |||
) |
Removes an order from all vehicles.
Triggers when, say, a station is removed.
type | The type of the order (OT_GOTO_[STATION|DEPOT|WAYPOINT]). | |
destination | The destination. Can be a StationID, DepotID or WaypointID. |
Definition at line 1443 of file order_cmd.cpp.
References Vehicle::current_order, DeleteOrder(), Vehicle::FirstShared(), Order::GetDepotActionType(), Order::GetDestination(), Order::GetType(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_VEH_ORDER_ID, InvalidateVehicleOrder(), Order::IsType(), Order::MakeDummy(), Vehicle::NextShared(), ODATFB_NEAREST_DEPOT, SetWindowDirty(), BaseVehicle::type, and VEH_AIRCRAFT.
Referenced by Depot::~Depot(), and Station::~Station().
Update the vehicle's destination tile from an order.
order | the order the vehicle currently has | |
v | the vehicle to update | |
conditional_depth | the depth (amount of steps) to go with conditional orders. This to prevent infinite loops. |
Definition at line 1609 of file order_cmd.cpp.
References AircraftNextAirportPos_and_Order(), CMD_REVERSE_TRAIN_DIRECTION, Vehicle::cur_order_index, Vehicle::current_order, Vehicle::current_order_time, DC_EXEC, Vehicle::dest_tile, DoCommand(), Vehicle::FindClosestDepot(), FLYING, Order::Free(), SpecializedVehicle< Aircraft, VEH_AIRCRAFT >::From(), SpecializedStation< Waypoint, true >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_depot_pool >::Get(), Order::GetDepotActionType(), Order::GetDepotOrderType(), Order::GetDestination(), Vehicle::GetNextManualOrder(), Order::GetNonStopType(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), Vehicle::GetOrderStationLocation(), Order::GetRefitCargo(), Order::GetRefitSubtype(), Order::GetType(), Vehicle::IncrementOrderIndex(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_VEH_ORDER_ID, Order::MakeGoToDepot(), Vehicle::NeedsServicing(), ODATFB_NEAREST_DEPOT, ODTFB_SERVICE, ProcessConditionalOrder(), Aircraft::state, Aircraft::targetairport, Vehicle::tile, Order::travel_time, BaseVehicle::type, UpdateOrderDest(), VEH_AIRCRAFT, and VEH_TRAIN.
Referenced by ProcessOrders(), VehicleOrderSaver::SwitchToNextOrder(), and UpdateOrderDest().