summaryrefslogtreecommitdiff
path: root/ship_cmd.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-03-20 08:43:29 +0000
committercelestar <celestar@openttd.org>2005-03-20 08:43:29 +0000
commitfbc2eacadedf6638ec483d4a1523b0d88b2330c9 (patch)
tree8b29056376eae4d8c996e8f1964095b4f7d3081f /ship_cmd.c
parent087d78d4655c36996396b3e98d489891d767252c (diff)
downloadopenttd-fbc2eacadedf6638ec483d4a1523b0d88b2330c9.tar.xz
(svn r2034) -Codechange: Replaced the rather meaningless LOAD and UNLOAD flags for depots by something more meaningful
Diffstat (limited to 'ship_cmd.c')
-rw-r--r--ship_cmd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ship_cmd.c b/ship_cmd.c
index b8588ede1..3ccf8c11c 100644
--- a/ship_cmd.c
+++ b/ship_cmd.c
@@ -108,7 +108,7 @@ static void CheckIfShipNeedsService(Vehicle *v)
return;
if (v->current_order.type == OT_GOTO_DEPOT &&
- v->current_order.flags & OF_FULL_LOAD)
+ v->current_order.flags & OF_HALT_IN_DEPOT)
return;
if (_patches.gotodepot && VehicleHasDepotOrders(v))
@@ -430,9 +430,9 @@ static void ShipEnterDepot(Vehicle *v)
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
- if (t.flags & OF_UNLOAD) {
+ if (HASBIT(t.flags, OFB_PART_OF_ORDERS)) {
v->cur_order_index++;
- } else if (t.flags & OF_FULL_LOAD) {
+ } else if (HASBIT(t.flags, OFB_HALT_IN_DEPOT)) {
v->vehstatus |= VS_STOPPED;
if (v->owner == _local_player) {
SetDParam(0, v->unitnumber);
@@ -993,7 +993,10 @@ int32 CmdSendShipToDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (v->current_order.type == OT_GOTO_DEPOT) {
if (flags & DC_EXEC) {
- if (v->current_order.flags & OF_UNLOAD) v->cur_order_index++;
+
+ if (HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS))
+ v->cur_order_index++;
+
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
@@ -1006,7 +1009,7 @@ int32 CmdSendShipToDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
v->dest_tile = depot->xy;
v->current_order.type = OT_GOTO_DEPOT;
- v->current_order.flags = OF_NON_STOP | OF_FULL_LOAD;
+ v->current_order.flags = OF_NON_STOP | OF_HALT_IN_DEPOT;
v->current_order.station = depot->index;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
}