summaryrefslogtreecommitdiff
path: root/order_cmd.c
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-05-03 22:18:40 +0000
committermatthijs <matthijs@openttd.org>2005-05-03 22:18:40 +0000
commit95c040b72302d760ad1c4d14a95e1fedf1f77a1b (patch)
tree54160d4e491acb81a42eb5056eccb187ebdb5624 /order_cmd.c
parentb2efecd9b46433a6dc993eccc1cadcf36515244b (diff)
downloadopenttd-95c040b72302d760ad1c4d14a95e1fedf1f77a1b.tar.xz
(svn r2264) - Fix: [ 1060686 1187655 ] Changing the full-load flag on the current order doesn't take effect immediately. (glx)
Diffstat (limited to 'order_cmd.c')
-rw-r--r--order_cmd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/order_cmd.c b/order_cmd.c
index ee82c1e3d..1e886c2d3 100644
--- a/order_cmd.c
+++ b/order_cmd.c
@@ -534,7 +534,7 @@ int32 CmdSkipOrder(int x, int y, uint32 flags, uint32 vehicle_id, uint32 not_use
/**
*
- * Add an order to the orderlist of a vehicle
+ * Modify an order in the orderlist of a vehicle
*
* @param veh_sel First 16 bits are the ID of the vehicle. The next 16 are the selected order (if any)
* If the lastone is given, order will be inserted above thatone
@@ -580,10 +580,14 @@ int32 CmdModifyOrder(int x, int y, uint32 flags, uint32 veh_sel, uint32 mode)
return CMD_ERROR;
}
- /* Update the windows, also for vehicles that share the same order list */
+ /* Update the windows and full load flags, also for vehicles that share the same order list */
{
Vehicle *u = GetFirstVehicleFromSharedList(v);
while (u != NULL) {
+ /* toggle u->current_order "Full load" flag if it changed */
+ if (sel == u->cur_order_index &&
+ HASBIT(u->current_order.flags, OFB_FULL_LOAD) != HASBIT(order->flags, OFB_FULL_LOAD))
+ TOGGLEBIT(u->current_order.flags, OFB_FULL_LOAD);
InvalidateVehicleOrder(u);
u = u->next_shared;
}