diff options
author | KUDr <kudr@openttd.org> | 2007-01-13 18:55:54 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2007-01-13 18:55:54 +0000 |
commit | 9bfb3f08d95bf308eb5da9e59b9dc9fb214de6a1 (patch) | |
tree | ffa45998168a4f37d45b9d9d3e429ee18cc906c0 /src/ship_cmd.cpp | |
parent | 1f0206f62d478540f7b96a86999944b0cdac7492 (diff) | |
download | openttd-9bfb3f08d95bf308eb5da9e59b9dc9fb214de6a1.tar.xz |
(svn r8110) -Codechange: direct Vehicle::current_order.type changes (to OT_LOADING and OT_LEAVESTATION) replaced by v->BeginLoading() and v->LeaveStation() calls. This should allow easy hooking of those state transitions in order to maintain vehicle loading queue.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r-- | src/ship_cmd.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index da5a40d54..bd4e2d760 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -292,8 +292,7 @@ static void HandleShipLoading(Vehicle *v) { Order b = v->current_order; - v->current_order.type = OT_LEAVESTATION; - v->current_order.flags = 0; + v->LeaveStation(); if (!(b.flags & OF_NON_STOP)) return; } } @@ -704,7 +703,7 @@ static void ShipController(Vehicle *v) /* Process station in the orderlist. */ st = GetStation(v->current_order.dest); if (st->facilities & FACIL_DOCK) { /* ugly, ugly workaround for problem with ships able to drop off cargo at wrong stations */ - v->current_order.type = OT_LOADING; + v->BeginLoading(); v->current_order.flags &= OF_FULL_LOAD | OF_UNLOAD | OF_TRANSFER; v->current_order.flags |= OF_NON_STOP; ShipArrivesAt(v, st); @@ -717,7 +716,6 @@ static void ShipController(Vehicle *v) InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); } else { /* leave stations without docks right aways */ v->current_order.type = OT_LEAVESTATION; - v->current_order.flags = 0; v->cur_order_index++; InvalidateVehicleOrder(v); } |