From 6e12838376d11a88074f1eb40d472bb42d8a015b Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 14 Jul 2013 20:21:36 +0000 Subject: (svn r25612) -Fix [FS#5648]: [AI] Don't return ERR_UNKNOWN when trying to move an order to its current location --- src/script/api/script_order.cpp | 1 + src/script/api/script_order.hpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/script/api/script_order.cpp b/src/script/api/script_order.cpp index 8b55cabb4..3087caa65 100644 --- a/src/script/api/script_order.cpp +++ b/src/script/api/script_order.cpp @@ -627,6 +627,7 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position_move)); EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position_target)); + EnforcePrecondition(false, order_position_move != order_position_target); int order_pos_move = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position_move); int order_pos_target = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position_target); diff --git a/src/script/api/script_order.hpp b/src/script/api/script_order.hpp index 68702afdb..63089a2bd 100644 --- a/src/script/api/script_order.hpp +++ b/src/script/api/script_order.hpp @@ -524,6 +524,7 @@ public: * @param order_position_target The target order * @pre IsValidVehicleOrder(vehicle_id, order_position_move). * @pre IsValidVehicleOrder(vehicle_id, order_position_target). + * @pre order_position_move != order_position_target. * @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY * @return True if and only if the order was moved. * @note If the order is moved to a lower place (e.g. from 7 to 2) -- cgit v1.2.3-70-g09d2