mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r18471) -Codechange/Fix: [NoAI] Deduplicate code betweeen AIVehicle::SkipToVehicleOrder and AIOrder::SkipToOrder. They are the same. Also ORDER_CURRENT was not allowed for the latter, but well...
This commit is contained in:
parent
9be2c8c6bd
commit
9c75ffb8c5
@ -397,6 +397,8 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
|||||||
|
|
||||||
/* static */ bool AIOrder::SkipToOrder(VehicleID vehicle_id, OrderPosition next_order)
|
/* static */ bool AIOrder::SkipToOrder(VehicleID vehicle_id, OrderPosition next_order)
|
||||||
{
|
{
|
||||||
|
next_order = AIOrder::ResolveOrderPosition(vehicle_id, next_order);
|
||||||
|
|
||||||
EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, next_order));
|
EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, next_order));
|
||||||
|
|
||||||
return AIObject::DoCommand(0, vehicle_id, next_order, CMD_SKIP_TO_ORDER);
|
return AIObject::DoCommand(0, vehicle_id, next_order, CMD_SKIP_TO_ORDER);
|
||||||
|
@ -195,11 +195,7 @@
|
|||||||
|
|
||||||
/* static */ bool AIVehicle::SkipToVehicleOrder(VehicleID vehicle_id, AIOrder::OrderPosition order_position)
|
/* static */ bool AIVehicle::SkipToVehicleOrder(VehicleID vehicle_id, AIOrder::OrderPosition order_position)
|
||||||
{
|
{
|
||||||
order_position = AIOrder::ResolveOrderPosition(vehicle_id, order_position);
|
return AIOrder::SkipToOrder(vehicle_id, order_position);
|
||||||
|
|
||||||
EnforcePrecondition(false, AIOrder::IsValidVehicleOrder(vehicle_id, order_position));
|
|
||||||
|
|
||||||
return AIObject::DoCommand(0, vehicle_id, order_position, CMD_SKIP_TO_ORDER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool AIVehicle::ReverseVehicle(VehicleID vehicle_id)
|
/* static */ bool AIVehicle::ReverseVehicle(VehicleID vehicle_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user