diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 4de6833473..23b163c6a9 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -1075,23 +1075,24 @@ namespace OpenRCT2::Ui::Windows break; case INFORMATION_TYPE_EXCITEMENT: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - const auto leftValue = thisRide.ratings.isNull() ? kRideRatingUndefined : thisRide.ratings.excitement; - const auto rightValue = otherRide.ratings.isNull() ? kRideRatingUndefined + const auto leftValue = thisRide.ratings.isNull() ? RideRating::kUndefined : thisRide.ratings.excitement; + const auto rightValue = otherRide.ratings.isNull() ? RideRating::kUndefined : otherRide.ratings.excitement; return leftValue <= rightValue; }); break; case INFORMATION_TYPE_INTENSITY: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - const auto leftValue = thisRide.ratings.isNull() ? kRideRatingUndefined : thisRide.ratings.intensity; - const auto rightValue = otherRide.ratings.isNull() ? kRideRatingUndefined : otherRide.ratings.intensity; + const auto leftValue = thisRide.ratings.isNull() ? RideRating::kUndefined : thisRide.ratings.intensity; + const auto rightValue = otherRide.ratings.isNull() ? RideRating::kUndefined + : otherRide.ratings.intensity; return leftValue <= rightValue; }); break; case INFORMATION_TYPE_NAUSEA: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - const auto leftValue = thisRide.ratings.isNull() ? kRideRatingUndefined : thisRide.ratings.nausea; - const auto rightValue = otherRide.ratings.isNull() ? kRideRatingUndefined : otherRide.ratings.nausea; + const auto leftValue = thisRide.ratings.isNull() ? RideRating::kUndefined : thisRide.ratings.nausea; + const auto rightValue = otherRide.ratings.isNull() ? RideRating::kUndefined : otherRide.ratings.nausea; return leftValue <= rightValue; }); break; diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index af0d5c0930..c0e4bb6790 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -2311,10 +2311,10 @@ static void RideRatingsApplyPenaltyLateralGs(OpenRCT2::RideRating::Tuple& rating bool OpenRCT2::RideRating::Tuple::isNull() const { - return excitement == kRideRatingUndefined; + return excitement == kUndefined; } void OpenRCT2::RideRating::Tuple::setNull() { - excitement = kRideRatingUndefined; + excitement = kUndefined; } diff --git a/src/openrct2/ride/RideRatings.h b/src/openrct2/ride/RideRatings.h index 40cc924e0c..3a5deb9dae 100644 --- a/src/openrct2/ride/RideRatings.h +++ b/src/openrct2/ride/RideRatings.h @@ -29,10 +29,11 @@ constexpr ride_rating MakeRideRating(int16_t whole, uint8_t fraction) { return MakeFixed2dp(whole, fraction); } -constexpr ride_rating kRideRatingUndefined = 0xFFFFu; namespace OpenRCT2::RideRating { + constexpr ride_rating kUndefined = 0xFFFFu; + #pragma pack(push, 1) // Used for return values, for functions that modify all three.