summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_order.hpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-02-06 12:15:17 +0000
committeryexo <yexo@openttd.org>2011-02-06 12:15:17 +0000
commit6f730b11246ab085d3b6092175f6785702a756d7 (patch)
treeca15128f6332f860b207f9f62597adec40289095 /src/ai/api/ai_order.hpp
parent3bb7f7ebe4d097fe6061db5abf3bdc4fc10f9353 (diff)
downloadopenttd-6f730b11246ab085d3b6092175f6785702a756d7.tar.xz
(svn r21992) -Fix [FS#4467]: AIs trying to change the AIOF_GOTO_NEAREST_DEPOT flag for existing orders triggered an assert. Explicitly forbid this as precondition for SetOrderFlags
Diffstat (limited to 'src/ai/api/ai_order.hpp')
-rw-r--r--src/ai/api/ai_order.hpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ai/api/ai_order.hpp b/src/ai/api/ai_order.hpp
index bfd10a0a9..14f07e6de 100644
--- a/src/ai/api/ai_order.hpp
+++ b/src/ai/api/ai_order.hpp
@@ -457,6 +457,7 @@ public:
* @param order_flags The new flags given to the order.
* @pre IsValidVehicleOrder(vehicle_id, order_position).
* @pre AreOrderFlagsValid(GetOrderDestination(vehicle_id, order_position), order_flags).
+ * @pre (order_flags & AIOF_GOTO_NEAREST_DEPOT) == (GetOrderFlags(vehicle_id, order_position) & AIOF_GOTO_NEAREST_DEPOT).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return True if and only if the order was changed.
*/