diff src/train_cmd.cpp @ 6263:715aa17970ab draft

(svn r9072) -Codechange: [Orders] added methods to orders to free them and check if they are in use
author bjarni <bjarni@openttd.org>
date Thu, 08 Mar 2007 21:39:34 +0000 (2007-03-08)
parents 4a39d6291d58
children a2428077ccb4
line wrap: on
line diff
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2454,8 +2454,7 @@
 
 	// 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 @@
 					}
 
 					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);
 					}
 				}