summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-03-08 21:39:34 +0000
committerbjarni <bjarni@openttd.org>2007-03-08 21:39:34 +0000
commitc2b7d0192d2b07ca7e4d87d583dabb2e43df49ec (patch)
treecfdbc180c9140ada4cb0bc22da9defe931609d16 /src/train_cmd.cpp
parentdaeac3d310a6bf367eb77f0b965f8930dc187899 (diff)
downloadopenttd-c2b7d0192d2b07ca7e4d87d583dabb2e43df49ec.tar.xz
(svn r9072) -Codechange: [Orders] added methods to orders to free them and check if they are in use
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index ad511aa07..e00f03e92 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2454,8 +2454,7 @@ static bool ProcessTrainOrder(Vehicle *v)
// If no order, do nothing.
if (order == NULL) {
- v->current_order.type = OT_NOTHING;
- v->current_order.flags = 0;
+ v->current_order.Free();
v->dest_tile = 0;
return false;
}
@@ -2910,8 +2909,7 @@ static void TrainController(Vehicle *v, bool update_image)
}
if (v->current_order.type == OT_LEAVESTATION) {
- v->current_order.type = OT_NOTHING;
- v->current_order.flags = 0;
+ v->current_order.Free();
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
}
}