Changeset - r13929:bc7dece1f96b
[Not reviewed]
master
0 2 0
frosch - 14 years ago 2009-12-12 22:15:14
frosch@openttd.org
(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...
2 files changed with 3 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/ai/api/ai_order.cpp
Show inline comments
 
@@ -397,6 +397,8 @@ static const Order *ResolveOrder(Vehicle
 

	
 
/* 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));
 

	
 
	return AIObject::DoCommand(0, vehicle_id, next_order, CMD_SKIP_TO_ORDER);
src/ai/api/ai_vehicle.cpp
Show inline comments
 
@@ -195,11 +195,7 @@
 

	
 
/* static */ bool AIVehicle::SkipToVehicleOrder(VehicleID vehicle_id, AIOrder::OrderPosition order_position)
 
{
 
	order_position = AIOrder::ResolveOrderPosition(vehicle_id, order_position);
 

	
 
	EnforcePrecondition(false, AIOrder::IsValidVehicleOrder(vehicle_id, order_position));
 

	
 
	return AIObject::DoCommand(0, vehicle_id, order_position, CMD_SKIP_TO_ORDER);
 
	return AIOrder::SkipToOrder(vehicle_id, order_position);
 
}
 

	
 
/* static */ bool AIVehicle::ReverseVehicle(VehicleID vehicle_id)
0 comments (0 inline, 0 general)