summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2007-01-13 18:55:54 +0000
committerKUDr <KUDr@openttd.org>2007-01-13 18:55:54 +0000
commit92e42d621d24459fdfb8231e69e66562c1f5e759 (patch)
treeffa45998168a4f37d45b9d9d3e429ee18cc906c0 /src/train_cmd.cpp
parenta6c23ae1ed38c25ce1cacfca025adc196c9071a5 (diff)
downloadopenttd-92e42d621d24459fdfb8231e69e66562c1f5e759.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/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 98c2dac06..5f2acb663 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2647,8 +2647,7 @@ static void HandleTrainLoading(Vehicle *v, bool mode)
{
Order b = v->current_order;
- v->current_order.type = OT_LEAVESTATION;
- v->current_order.flags = 0;
+ v->LeaveStation();
// If this was not the final order, don't remove it from the list.
if (!(b.flags & OF_NON_STOP)) return;
@@ -2721,12 +2720,12 @@ static void TrainEnterStation(Vehicle *v, StationID station)
v->current_order.dest == station) {
// Yeah, keep the load/unload flags
// Non Stop now means if the order should be increased.
- 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;
} else {
// No, just do a simple load
- v->current_order.type = OT_LOADING;
+ v->BeginLoading();
v->current_order.flags = 0;
}
v->current_order.dest = 0;