(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)
This commit is contained in:
truelight 2006-08-26 17:12:24 +00:00
parent 5dc121d1c1
commit 39ae8d29e1
4 changed files with 10 additions and 10 deletions

View File

@ -42,7 +42,7 @@ typedef uint16 IndustryID;
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;

View File

@ -89,7 +89,7 @@ typedef struct Order {
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 @@ static inline uint16 GetOrderPoolSize(void)
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

View File

@ -176,7 +176,7 @@ int32 CmdInsertOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
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 @@ int32 CmdDeleteOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
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 @@ int32 CmdSkipOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
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 @@ int32 CmdModifyOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
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 @@ void RestoreVehicleOrders(const Vehicle* v, const BackuppedOrders* bak)
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;

View File

@ -190,10 +190,10 @@ struct Vehicle {
/* 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