diff options
author | michi_cc <michi_cc@openttd.org> | 2012-12-20 19:44:02 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2012-12-20 19:44:02 +0000 |
commit | c75962e04c0999c0c458b2ee54519f094d7c6543 (patch) | |
tree | 77dfc5b80771380cba34acf3f6ed564ce8be0657 /src/order_cmd.cpp | |
parent | 8eb1cb4ebbfa2b00ca27f860555f5397fe5a1c9e (diff) | |
download | openttd-c75962e04c0999c0c458b2ee54519f094d7c6543.tar.xz |
(svn r24833) -Codechange: Replace magic numbers for invalidating vehicle-related windows with an enum.
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r-- | src/order_cmd.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 0ce3059c9..9fe0a4c3f 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -915,7 +915,7 @@ static CommandCost DecloneOrder(Vehicle *dst, DoCommandFlag flags) { if (flags & DC_EXEC) { DeleteVehicleOrders(dst); - InvalidateVehicleOrder(dst, -1); + InvalidateVehicleOrder(dst, VIWD_REMOVE_ALL_ORDERS); InvalidateWindowClassesData(GetWindowClassForVehicleType(dst->type), 0); } return CommandCost(); @@ -1054,7 +1054,7 @@ CommandCost CmdSkipToOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (v->current_order.IsType(OT_LOADING)) v->LeaveStation(); - InvalidateVehicleOrder(v, -2); + InvalidateVehicleOrder(v, VIWD_MODIFY_ORDERS); } /* We have an aircraft/ship, they have a mini-schedule, so update them all */ @@ -1393,7 +1393,7 @@ CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 u->current_order.GetLoadType() != order->GetLoadType()) { u->current_order.SetLoadType(order->GetLoadType()); } - InvalidateVehicleOrder(u, -2); + InvalidateVehicleOrder(u, VIWD_MODIFY_ORDERS); } } @@ -1503,8 +1503,8 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /* Link this vehicle in the shared-list */ dst->AddToShared(src); - InvalidateVehicleOrder(dst, -1); - InvalidateVehicleOrder(src, -2); + InvalidateVehicleOrder(dst, VIWD_REMOVE_ALL_ORDERS); + InvalidateVehicleOrder(src, VIWD_MODIFY_ORDERS); InvalidateWindowClassesData(GetWindowClassForVehicleType(dst->type), 0); } @@ -1566,7 +1566,7 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 dst->orders.list = new OrderList(first, dst); } - InvalidateVehicleOrder(dst, -1); + InvalidateVehicleOrder(dst, VIWD_REMOVE_ALL_ORDERS); InvalidateWindowClassesData(GetWindowClassForVehicleType(dst->type), 0); } @@ -1624,7 +1624,7 @@ CommandCost CmdOrderRefit(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 for (Vehicle *u = v->FirstShared(); u != NULL; u = u->NextShared()) { /* Update any possible open window of the vehicle */ - InvalidateVehicleOrder(u, -2); + InvalidateVehicleOrder(u, VIWD_MODIFY_ORDERS); /* If the vehicle already got the current depot set as current order, then update current order as well */ if (u->cur_real_order_index == order_number && (u->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS)) { @@ -2093,7 +2093,7 @@ bool ProcessOrders(Vehicle *v) /* Otherwise set it, and determine the destination tile. */ v->current_order = *order; - InvalidateVehicleOrder(v, -2); + InvalidateVehicleOrder(v, VIWD_MODIFY_ORDERS); switch (v->type) { default: NOT_REACHED(); |