diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 3558a2133c..40b15af0c2 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -919,7 +919,7 @@ private: } dst->testing_flags = src->testing_flags; dst->current_test_segment = src->current_test_segment; - dst->current_test_station = 0xFF; + dst->current_test_station = STATION_INDEX_NULL; dst->average_speed_test_timeout = src->average_speed_test_timeout; dst->slide_in_use = src->slide_in_use; dst->slide_peep_t_shirt_colour = RCT1::GetColour(src->slide_peep_t_shirt_colour); diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index b9b004993e..d5c8e0f9ca 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -373,7 +373,7 @@ int32_t cable_lift_update_track_motion(Vehicle* cableLift) _vehicleF64E2C = 0; gCurrentVehicle = cableLift; _vehicleMotionTrackFlags = 0; - _vehicleStationIndex = 0xFF; + _vehicleStationIndex = STATION_INDEX_NULL; cableLift->velocity += cableLift->acceleration; _vehicleVelocityF64E08 = cableLift->velocity; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 2e0ad9c282..849a6b26bb 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -3770,7 +3770,7 @@ static StationIndex ride_mode_check_valid_station_numbers(Ride* ride) /** * returns stationIndex of first station on success - * -1 on failure. + * STATION_INDEX_NULL on failure. */ static StationIndex ride_mode_check_station_present(Ride* ride) { diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index bac8e8f497..acc6da2ffe 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -193,7 +193,7 @@ struct RideMeasurement uint16_t num_items{}; uint16_t current_item{}; uint8_t vehicle_index{}; - uint8_t current_station{}; + StationIndex current_station{}; int8_t vertical[MAX_ITEMS]{}; int8_t lateral[MAX_ITEMS]{}; uint8_t velocity[MAX_ITEMS]{}; @@ -373,7 +373,7 @@ struct Ride uint16_t guests_favourite; uint32_t lifecycle_flags; uint16_t total_air_time; - uint8_t current_test_station; + StationIndex current_test_station; uint8_t num_circuits; CoordsXYZ CableLiftLoc; uint16_t cable_lift; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index d9b03c6d9d..c78ce7df8f 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -96,7 +96,7 @@ constexpr int16_t VEHICLE_STOPPING_SPIN_SPEED = 600; Vehicle* gCurrentVehicle; static uint8_t _vehicleBreakdown; -uint8_t _vehicleStationIndex; +StationIndex _vehicleStationIndex; uint32_t _vehicleMotionTrackFlags; int32_t _vehicleVelocityF64E08; int32_t _vehicleVelocityF64E0C; @@ -1559,7 +1559,7 @@ static void vehicle_update_measurements(Vehicle* vehicle) return; } - if (ride->current_test_station == 0xFF) + if (ride->current_test_station == STATION_INDEX_NULL) return; if (!ride_get_entrance_location(ride, ride->current_test_station).isNull()) @@ -7860,7 +7860,7 @@ static void sub_6DBF3E(Vehicle* vehicle) return; } - if (_vehicleStationIndex == 0xFF) + if (_vehicleStationIndex == STATION_INDEX_NULL) { _vehicleStationIndex = tileElement->AsTrack()->GetStationIndex(); } @@ -9552,7 +9552,7 @@ int32_t vehicle_update_track_motion(Vehicle* vehicle, int32_t* outStation) _vehicleF64E2C = 0; gCurrentVehicle = vehicle; _vehicleMotionTrackFlags = 0; - _vehicleStationIndex = 0xFF; + _vehicleStationIndex = STATION_INDEX_NULL; vehicle_update_track_motion_up_stop_check(vehicle); check_and_apply_block_section_stop_site(vehicle); diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 719c134aba..1fb7aaad60 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -519,7 +519,7 @@ uint16_t vehicle_get_move_info_size(int32_t trackSubposition, int32_t typeAndDir bool vehicle_update_dodgems_collision(Vehicle* vehicle, int16_t x, int16_t y, uint16_t* spriteId); extern Vehicle* gCurrentVehicle; -extern uint8_t _vehicleStationIndex; +extern StationIndex _vehicleStationIndex; extern uint32_t _vehicleMotionTrackFlags; extern int32_t _vehicleVelocityF64E08; extern int32_t _vehicleVelocityF64E0C;