changeset 4391:4daf41d96969 draft

(svn r6144) -Codechange: renamed OrderID to VehicleOrderID, because it had nothing to do with the Order-pool, but with the place of the order within the vehicle-order (hence its name) (part of FS#13, blathijs)
author truelight <truelight@openttd.org>
date Sat, 26 Aug 2006 17:12:24 +0000
parents 495ca5f888cc
children c94e96e24010
files openttd.h order.h order_cmd.c vehicle.h
diffstat 4 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/openttd.h
+++ b/openttd.h
@@ -42,7 +42,7 @@
 typedef uint16 DepotID;
 typedef uint16 WaypointID;
 typedef byte PlayerID;
-typedef byte OrderID;
+typedef byte VehicleOrderID;  ///< The index of an order within its current vehicle (not pool related)
 typedef byte CargoID;
 typedef byte LandscapeID;
 typedef uint16 StringID;
--- a/order.h
+++ b/order.h
@@ -89,7 +89,7 @@
 
 typedef struct {
 	VehicleID clone;
-	OrderID orderindex;
+	VehicleOrderID orderindex;
 	Order order[MAX_BACKUP_ORDER_COUNT + 1];
 	uint16 service_interval;
 	char name[32];
@@ -116,7 +116,7 @@
 	return _order_pool.total_items;
 }
 
-static inline OrderID GetOrderArraySize(void)
+static inline VehicleOrderID GetOrderArraySize(void)
 {
 	/* TODO - This isn't the real content of the function, but
 	 *  with the new pool-system this will be replaced with one that
--- a/order_cmd.c
+++ b/order_cmd.c
@@ -176,7 +176,7 @@
 {
 	Vehicle *v;
 	VehicleID veh   = GB(p1,  0, 16);
-	OrderID sel_ord = GB(p1, 16, 16);
+	VehicleOrderID sel_ord = GB(p1, 16, 16);
 	Order new_order = UnpackOrder(p2);
 
 	if (!IsValidVehicleID(veh)) return CMD_ERROR;
@@ -438,7 +438,7 @@
 {
 	Vehicle *v, *u;
 	VehicleID veh_id = p1;
-	OrderID sel_ord = p2;
+	VehicleOrderID sel_ord = p2;
 	Order *order;
 
 	if (!IsValidVehicleID(veh_id)) return CMD_ERROR;
@@ -523,7 +523,7 @@
 
 	if (flags & DC_EXEC) {
 		/* Goto next order */
-		OrderID b = v->cur_order_index + 1;
+		VehicleOrderID b = v->cur_order_index + 1;
 		if (b >= v->num_orders) b = 0;
 
 		v->cur_order_index = b;
@@ -561,7 +561,7 @@
 {
 	Vehicle *v;
 	Order *order;
-	OrderID sel_ord = GB(p1, 16, 16); // XXX - automatically truncated to 8 bits.
+	VehicleOrderID sel_ord = GB(p1, 16, 16); // XXX - automatically truncated to 8 bits.
 	VehicleID veh   = GB(p1,  0, 16);
 
 	if (!IsValidVehicleID(veh)) return CMD_ERROR;
@@ -845,7 +845,7 @@
 int32 CmdRestoreOrderIndex(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Vehicle *v;
-	OrderID cur_ord = GB(p2,  0, 16);
+	VehicleOrderID cur_ord = GB(p2,  0, 16);
 	uint16 serv_int = GB(p2, 16, 16);
 
 	if (!IsValidVehicleID(p1)) return CMD_ERROR;
--- a/vehicle.h
+++ b/vehicle.h
@@ -190,10 +190,10 @@
 
 	/* Begin Order-stuff */
 	Order current_order;     ///< The current order (+ status, like: loading)
-	OrderID cur_order_index; ///< The index to the current order
+	VehicleOrderID cur_order_index; ///< The index to the current order
 
 	Order *orders;           ///< Pointer to the first order for this vehicle
-	OrderID num_orders;      ///< How many orders there are in the list
+	VehicleOrderID num_orders;      ///< How many orders there are in the list
 
 	Vehicle *next_shared;    ///< If not NULL, this points to the next vehicle that shared the order
 	Vehicle *prev_shared;    ///< If not NULL, this points to the prev vehicle that shared the order