(svn r7559) -Fix (FS#456): clicking the 'Full Load' button when the 'current' order is selected in the Order GUI and one has instructed the train to go to the depot, via the button in the Train View GUI, changed the depot order by switching from 'service at depot' to 'stop at depot' and vice versa.
authorrubidium
Tue, 26 Dec 2006 00:33:07 +0000
changeset 5562 6ad177b6c9ff
parent 5561 e91dafc6c3b7
child 5563 d17a2d8cd77c
(svn r7559) -Fix (FS#456): clicking the 'Full Load' button when the 'current' order is selected in the Order GUI and one has instructed the train to go to the depot, via the button in the Train View GUI, changed the depot order by switching from 'service at depot' to 'stop at depot' and vice versa.
order_cmd.c
--- a/order_cmd.c	Mon Dec 25 16:14:36 2006 +0000
+++ b/order_cmd.c	Tue Dec 26 00:33:07 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);
 				}