equal
deleted
inserted
replaced
114 |
114 |
115 void Free(); |
115 void Free(); |
116 void FreeChain(); |
116 void FreeChain(); |
117 }; |
117 }; |
118 |
118 |
119 #define MAX_BACKUP_ORDER_COUNT 40 |
|
120 |
|
121 struct BackuppedOrders { |
119 struct BackuppedOrders { |
|
120 BackuppedOrders() : order(NULL) { } |
|
121 |
122 VehicleID clone; |
122 VehicleID clone; |
123 VehicleOrderID orderindex; |
123 VehicleOrderID orderindex; |
124 Order order[MAX_BACKUP_ORDER_COUNT + 1]; |
124 Order *order; |
125 uint16 service_interval; |
125 uint16 service_interval; |
126 char name[32]; |
126 char name[32]; |
127 }; |
127 }; |
128 |
128 |
129 VARDEF TileIndex _backup_orders_tile; |
129 VARDEF TileIndex _backup_orders_tile; |
130 VARDEF BackuppedOrders _backup_orders_data[1]; |
130 VARDEF BackuppedOrders _backup_orders_data; |
131 |
131 |
132 static inline VehicleOrderID GetMaxOrderIndex() |
132 static inline VehicleOrderID GetMaxOrderIndex() |
133 { |
133 { |
134 /* TODO - This isn't the real content of the function, but |
134 /* TODO - This isn't the real content of the function, but |
135 * with the new pool-system this will be replaced with one that |
135 * with the new pool-system this will be replaced with one that |
198 order.travel_time = 0; |
198 order.travel_time = 0; |
199 return order; |
199 return order; |
200 } |
200 } |
201 |
201 |
202 /* Functions */ |
202 /* Functions */ |
203 void BackupVehicleOrders(const Vehicle *v, BackuppedOrders *order); |
203 void BackupVehicleOrders(const Vehicle *v, BackuppedOrders *order = &_backup_orders_data); |
204 void RestoreVehicleOrders(const Vehicle* v, const BackuppedOrders* order); |
204 void RestoreVehicleOrders(const Vehicle *v, const BackuppedOrders *order = &_backup_orders_data); |
205 void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination); |
205 void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination); |
206 void InvalidateVehicleOrder(const Vehicle *v); |
206 void InvalidateVehicleOrder(const Vehicle *v); |
207 bool VehicleHasDepotOrders(const Vehicle *v); |
207 bool VehicleHasDepotOrders(const Vehicle *v); |
208 void CheckOrders(const Vehicle*); |
208 void CheckOrders(const Vehicle*); |
209 void DeleteVehicleOrders(Vehicle *v); |
209 void DeleteVehicleOrders(Vehicle *v); |