summaryrefslogtreecommitdiff
path: root/order_cmd.c
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-12-26 00:33:07 +0000
committerrubidium <rubidium@openttd.org>2006-12-26 00:33:07 +0000
commit28844c088c5a84d696cdf5ea2a1cf0e315ed7ce7 (patch)
treee79aa87fccd61b0f62c78a85d7f483efff3309d9 /order_cmd.c
parentc81256a2680d5da9b7d7939d1987e4be587b04ac (diff)
downloadopenttd-28844c088c5a84d696cdf5ea2a1cf0e315ed7ce7.tar.xz
(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.
Diffstat (limited to 'order_cmd.c')
-rw-r--r--order_cmd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/order_cmd.c b/order_cmd.c
index fe4511d77..4c318cb32 100644
--- a/order_cmd.c
+++ b/order_cmd.c
@@ -611,8 +611,17 @@ int32 CmdModifyOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
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);
}