order_cmd.c
branch0.5
changeset 5369 4363e2fc3e4a
parent 5216 d581e4db95b6
child 5443 4ef33c0ddab7
child 5568 75f13d7bfaed
--- a/order_cmd.c	Sat Dec 30 23:12:05 2006 +0000
+++ b/order_cmd.c	Sat Dec 30 23:14:39 2006 +0000
@@ -611,8 +611,17 @@
 			u = GetFirstVehicleFromSharedList(v);
 			DeleteOrderWarnings(u);
 			for (; u != NULL; u = u->next_shared) {
-				/* toggle u->current_order "Full load" flag if it changed */
+				/* Toggle u->current_order "Full load" flag if it changed.
+				 * However, as the same flag is used for depot orders, check
+				 * whether we are not going to a depot as there are three
+				 * cases where the full load flag can be active and only
+				 * one case where the flag is used for depot orders. In the
+				 * other cases for the OrderType the flags are not used,
+				 * so do not care and those orders should not be active
+				 * when this function is called.
+				 */
 				if (sel_ord == u->cur_order_index &&
+						u->current_order.type != OT_GOTO_DEPOT &&
 						HASBIT(u->current_order.flags, OFB_FULL_LOAD) != HASBIT(order->flags, OFB_FULL_LOAD)) {
 					TOGGLEBIT(u->current_order.flags, OFB_FULL_LOAD);
 				}