29 |
29 |
30 /** Road vehicle states */ |
30 /** Road vehicle states */ |
31 enum RoadVehicleStates { |
31 enum RoadVehicleStates { |
32 /* |
32 /* |
33 * Lower 4 bits are used for vehicle track direction. (Trackdirs) |
33 * Lower 4 bits are used for vehicle track direction. (Trackdirs) |
34 * When in a road stop (bit 5 set) these bits give the |
34 * When in a road stop (bit 5 or bit 6 set) these bits give the |
35 * track direction of the entry to the road stop. |
35 * track direction of the entry to the road stop. |
36 * As the entry direction will always be a diagonal |
36 * As the entry direction will always be a diagonal |
37 * direction (X_NE, Y_SE, X_SW or Y_NW) only bits 0 and 3 |
37 * direction (X_NE, Y_SE, X_SW or Y_NW) only bits 0 and 3 |
38 * are needed to hold this direction. Bit 1 is then used to show |
38 * are needed to hold this direction. Bit 1 is then used to show |
39 * that the vehicle is using the second road stop bay. |
39 * that the vehicle is using the second road stop bay. |
|
40 * Bit 2 is then used for drive-through stops to show the vehicle |
|
41 * is stopping at this road stop. |
40 */ |
42 */ |
41 |
43 |
42 /* Numeric values */ |
44 /* Numeric values */ |
43 RVSB_IN_DEPOT = 0xFE, ///< The vehicle is in a depot |
45 RVSB_IN_DEPOT = 0xFE, ///< The vehicle is in a depot |
44 RVSB_WORMHOLE = 0xFF, ///< The vehicle is in a tunnel and/or bridge |
46 RVSB_WORMHOLE = 0xFF, ///< The vehicle is in a tunnel and/or bridge |
45 |
47 |
46 /* Bit numbers */ |
48 /* Bit numbers */ |
47 RVS_USING_SECOND_BAY = 1, ///< Only used while in a road stop |
49 RVS_USING_SECOND_BAY = 1, ///< Only used while in a road stop |
48 RVS_IS_STOPPING = 2, ///< Only used for drive-through stops. Vehicle will stop here |
50 RVS_IS_STOPPING = 2, ///< Only used for drive-through stops. Vehicle will stop here |
49 RVS_DRIVE_SIDE = 4, ///< Only used when retrieving move data and for turning vehicles |
51 RVS_DRIVE_SIDE = 4, ///< Only used when retrieving move data |
50 RVS_IN_ROAD_STOP = 5, ///< The vehicle is in a road stop |
52 RVS_IN_ROAD_STOP = 5, ///< The vehicle is in a road stop |
51 RVS_IN_DT_ROAD_STOP = 6, ///< The vehicle is in a drive-through road stop |
53 RVS_IN_DT_ROAD_STOP = 6, ///< The vehicle is in a drive-through road stop |
52 |
54 |
53 /* Bit sets of the above specified bits */ |
55 /* Bit sets of the above specified bits */ |
54 RVSB_USING_SECOND_BAY = 1 << RVS_USING_SECOND_BAY, ///< Only used while in a road stop |
|
55 RVSB_DRIVE_SIDE = 1 << RVS_DRIVE_SIDE, ///< Only used when retrieving move data and for turning vehicles |
|
56 RVSB_IN_ROAD_STOP = 1 << RVS_IN_ROAD_STOP, ///< The vehicle is in a road stop |
56 RVSB_IN_ROAD_STOP = 1 << RVS_IN_ROAD_STOP, ///< The vehicle is in a road stop |
57 RVSB_IN_ROAD_STOP_END = RVSB_IN_ROAD_STOP + TRACKDIR_END, |
57 RVSB_IN_ROAD_STOP_END = RVSB_IN_ROAD_STOP + TRACKDIR_END, |
58 RVSB_IN_DT_ROAD_STOP = 1 << RVS_IN_DT_ROAD_STOP, ///< The vehicle is in a drive-through road stop |
58 RVSB_IN_DT_ROAD_STOP = 1 << RVS_IN_DT_ROAD_STOP, ///< The vehicle is in a drive-through road stop |
59 RVSB_IN_DT_ROAD_STOP_END = RVSB_IN_DT_ROAD_STOP + TRACKDIR_END, |
59 RVSB_IN_DT_ROAD_STOP_END = RVSB_IN_DT_ROAD_STOP + TRACKDIR_END, |
60 |
60 |
292 |
292 |
293 bool leave_depot_instantly; // NOSAVE: stores if the vehicle needs to leave the depot it just entered. Used by autoreplace |
293 bool leave_depot_instantly; // NOSAVE: stores if the vehicle needs to leave the depot it just entered. Used by autoreplace |
294 |
294 |
295 uint16 load_unload_time_rem; |
295 uint16 load_unload_time_rem; |
296 uint16 cargo_paid_for; // How much of the cargo currently on board has been paid for. |
296 uint16 cargo_paid_for; // How much of the cargo currently on board has been paid for. |
297 byte load_status; |
297 byte vehicle_flags; // Used for gradual loading and other miscellaneous things (@see VehicleFlags enum) |
298 |
298 |
299 int32 profit_this_year; |
299 int32 profit_this_year; |
300 int32 profit_last_year; |
300 int32 profit_last_year; |
|
301 int32 cargo_feeder_share; ///< value of feeder pickup to be paid for on delivery of cargo |
|
302 TileIndex cargo_loaded_at_xy; ///< tile index where feeder cargo was loaded |
301 uint32 value; |
303 uint32 value; |
302 |
304 |
303 union { |
305 union { |
304 VehicleRail rail; |
306 VehicleRail rail; |
305 VehicleAir air; |
307 VehicleAir air; |