86 /* If you change this, keep in mind that it is saved on 3 places: |
86 /* If you change this, keep in mind that it is saved on 3 places: |
87 * - Load_ORDR, all the global orders |
87 * - Load_ORDR, all the global orders |
88 * - Vehicle -> current_order |
88 * - Vehicle -> current_order |
89 * - REF_SHEDULE (all REFs are currently limited to 16 bits!!) |
89 * - REF_SHEDULE (all REFs are currently limited to 16 bits!!) |
90 */ |
90 */ |
91 typedef struct Order { |
91 struct Order { |
92 struct Order *next; ///< Pointer to next order. If NULL, end of list |
92 Order *next; ///< Pointer to next order. If NULL, end of list |
93 |
93 |
94 OrderTypeByte type; |
94 OrderTypeByte type; |
95 uint8 flags; |
95 uint8 flags; |
96 DestinationID dest; ///< The destionation of the order. |
96 DestinationID dest; ///< The destionation of the order. |
97 |
97 |
98 OrderID index; ///< Index of the order, is not saved or anything, just for reference |
98 OrderID index; ///< Index of the order, is not saved or anything, just for reference |
99 |
99 |
100 CargoID refit_cargo; // Refit CargoID |
100 CargoID refit_cargo; // Refit CargoID |
101 byte refit_subtype; // Refit subtype |
101 byte refit_subtype; // Refit subtype |
102 } Order; |
102 }; |
103 |
103 |
104 #define MAX_BACKUP_ORDER_COUNT 40 |
104 #define MAX_BACKUP_ORDER_COUNT 40 |
105 |
105 |
106 typedef struct { |
106 struct BackuppedOrders { |
107 VehicleID clone; |
107 VehicleID clone; |
108 VehicleOrderID orderindex; |
108 VehicleOrderID orderindex; |
109 Order order[MAX_BACKUP_ORDER_COUNT + 1]; |
109 Order order[MAX_BACKUP_ORDER_COUNT + 1]; |
110 uint16 service_interval; |
110 uint16 service_interval; |
111 char name[32]; |
111 char name[32]; |
112 } BackuppedOrders; |
112 }; |
113 |
113 |
114 VARDEF TileIndex _backup_orders_tile; |
114 VARDEF TileIndex _backup_orders_tile; |
115 VARDEF BackuppedOrders _backup_orders_data[1]; |
115 VARDEF BackuppedOrders _backup_orders_data[1]; |
116 |
116 |
117 DECLARE_OLD_POOL(Order, Order, 6, 1000) |
117 DECLARE_OLD_POOL(Order, Order, 6, 1000) |