mirror of https://github.com/OpenTTD/OpenTTD.git
(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:
parent
5dc121d1c1
commit
39ae8d29e1
|
@ -42,7 +42,7 @@ typedef uint16 IndustryID;
|
||||||
typedef uint16 DepotID;
|
typedef uint16 DepotID;
|
||||||
typedef uint16 WaypointID;
|
typedef uint16 WaypointID;
|
||||||
typedef byte PlayerID;
|
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 CargoID;
|
||||||
typedef byte LandscapeID;
|
typedef byte LandscapeID;
|
||||||
typedef uint16 StringID;
|
typedef uint16 StringID;
|
||||||
|
|
4
order.h
4
order.h
|
@ -89,7 +89,7 @@ typedef struct Order {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
VehicleID clone;
|
VehicleID clone;
|
||||||
OrderID orderindex;
|
VehicleOrderID orderindex;
|
||||||
Order order[MAX_BACKUP_ORDER_COUNT + 1];
|
Order order[MAX_BACKUP_ORDER_COUNT + 1];
|
||||||
uint16 service_interval;
|
uint16 service_interval;
|
||||||
char name[32];
|
char name[32];
|
||||||
|
@ -116,7 +116,7 @@ static inline uint16 GetOrderPoolSize(void)
|
||||||
return _order_pool.total_items;
|
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
|
/* TODO - This isn't the real content of the function, but
|
||||||
* with the new pool-system this will be replaced with one that
|
* with the new pool-system this will be replaced with one that
|
||||||
|
|
10
order_cmd.c
10
order_cmd.c
|
@ -176,7 +176,7 @@ int32 CmdInsertOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
{
|
{
|
||||||
Vehicle *v;
|
Vehicle *v;
|
||||||
VehicleID veh = GB(p1, 0, 16);
|
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);
|
Order new_order = UnpackOrder(p2);
|
||||||
|
|
||||||
if (!IsValidVehicleID(veh)) return CMD_ERROR;
|
if (!IsValidVehicleID(veh)) return CMD_ERROR;
|
||||||
|
@ -438,7 +438,7 @@ int32 CmdDeleteOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
{
|
{
|
||||||
Vehicle *v, *u;
|
Vehicle *v, *u;
|
||||||
VehicleID veh_id = p1;
|
VehicleID veh_id = p1;
|
||||||
OrderID sel_ord = p2;
|
VehicleOrderID sel_ord = p2;
|
||||||
Order *order;
|
Order *order;
|
||||||
|
|
||||||
if (!IsValidVehicleID(veh_id)) return CMD_ERROR;
|
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) {
|
if (flags & DC_EXEC) {
|
||||||
/* Goto next order */
|
/* Goto next order */
|
||||||
OrderID b = v->cur_order_index + 1;
|
VehicleOrderID b = v->cur_order_index + 1;
|
||||||
if (b >= v->num_orders) b = 0;
|
if (b >= v->num_orders) b = 0;
|
||||||
|
|
||||||
v->cur_order_index = b;
|
v->cur_order_index = b;
|
||||||
|
@ -561,7 +561,7 @@ int32 CmdModifyOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
{
|
{
|
||||||
Vehicle *v;
|
Vehicle *v;
|
||||||
Order *order;
|
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);
|
VehicleID veh = GB(p1, 0, 16);
|
||||||
|
|
||||||
if (!IsValidVehicleID(veh)) return CMD_ERROR;
|
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)
|
int32 CmdRestoreOrderIndex(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
{
|
{
|
||||||
Vehicle *v;
|
Vehicle *v;
|
||||||
OrderID cur_ord = GB(p2, 0, 16);
|
VehicleOrderID cur_ord = GB(p2, 0, 16);
|
||||||
uint16 serv_int = GB(p2, 16, 16);
|
uint16 serv_int = GB(p2, 16, 16);
|
||||||
|
|
||||||
if (!IsValidVehicleID(p1)) return CMD_ERROR;
|
if (!IsValidVehicleID(p1)) return CMD_ERROR;
|
||||||
|
|
|
@ -190,10 +190,10 @@ struct Vehicle {
|
||||||
|
|
||||||
/* Begin Order-stuff */
|
/* Begin Order-stuff */
|
||||||
Order current_order; ///< The current order (+ status, like: loading)
|
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
|
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 *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
|
Vehicle *prev_shared; ///< If not NULL, this points to the prev vehicle that shared the order
|
||||||
|
|
Loading…
Reference in New Issue