# HG changeset patch # User yexo # Date 2011-09-01 10:04:12 # Node ID 284e992f5af2f0351a029674b2222c506e0dce1f # Parent f64370f5bb7e90001177a3acf8b76f356ac769bb (svn r22863) -Fix (r22861): AIOrder::SetOrderCondition didn't accept the new condition diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp --- a/src/ai/api/ai_order.cpp +++ b/src/ai/api/ai_order.cpp @@ -336,7 +336,7 @@ static const Order *ResolveOrder(Vehicle { EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position)); EnforcePrecondition(false, order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position)); - EnforcePrecondition(false, condition >= OC_LOAD_PERCENTAGE && condition <= OC_UNCONDITIONALLY); + EnforcePrecondition(false, condition >= OC_LOAD_PERCENTAGE && condition <= OC_REMAINING_LIFETIME); return AIObject::DoCommand(0, vehicle_id | (order_position << 20), MOF_COND_VARIABLE | (condition << 4), CMD_MODIFY_ORDER); }