MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetOrderRefit

Method GetOrderRefit

src/script/api/script_order.cpp:376–383  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

374}
375
376/* static */ CargoType ScriptOrder::GetOrderRefit(VehicleID vehicle_id, OrderPosition order_position)
377{
378 if (!IsValidVehicleOrder(vehicle_id, order_position)) return CARGO_NO_REFIT;
379 if (order_position != ORDER_CURRENT && !IsGotoStationOrder(vehicle_id, order_position) && !IsGotoDepotOrder(vehicle_id, order_position)) return CARGO_NO_REFIT;
380
381 const Order *order = ::ResolveOrder(vehicle_id, order_position);
382 return order->IsRefit() ? order->GetRefitCargo() : CARGO_NO_REFIT;
383}
384
385/* static */ bool ScriptOrder::SetOrderJumpTo(VehicleID vehicle_id, OrderPosition order_position, OrderPosition jump_to)
386{

Callers

nothing calls this directly

Calls 3

ResolveOrderFunction · 0.85
IsRefitMethod · 0.80
GetRefitCargoMethod · 0.80

Tested by

no test coverage detected