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

Method GetStopLocation

src/script/api/script_order.cpp:366–374  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

364}
365
366/* static */ ScriptOrder::StopLocation ScriptOrder::GetStopLocation(VehicleID vehicle_id, OrderPosition order_position)
367{
368 if (!IsValidVehicleOrder(vehicle_id, order_position)) return STOPLOCATION_INVALID;
369 if (ScriptVehicle::GetVehicleType(vehicle_id) != ScriptVehicle::VT_RAIL) return STOPLOCATION_INVALID;
370 if (!IsGotoStationOrder(vehicle_id, order_position)) return STOPLOCATION_INVALID;
371
372 const Order *order = ::ResolveOrder(vehicle_id, order_position);
373 return (ScriptOrder::StopLocation)order->GetStopLocation();
374}
375
376/* static */ CargoType ScriptOrder::GetOrderRefit(VehicleID vehicle_id, OrderPosition order_position)
377{

Callers

nothing calls this directly

Calls 1

ResolveOrderFunction · 0.85

Tested by

no test coverage detected