1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Fix #22245: Unrated rides cause high amount of nausea (#22284)

Reverts #22199 changes that seem to cause a nausea bug on untested rides

Nulls are now considered higher values than anything, making them appear on the tail of ascending lists again

Checking for NULL in ratings.intensity and ratings.nausea didn't work, they seem to retain there values pre ratings reset and setting them to null would change the behaviour of the game - so instead we check for ratings.isNull() in the sorting to properly put null ratings to tail of sorted lists.
This commit is contained in:
Tomáš Chvojka
2024-07-17 12:52:00 +02:00
committed by GitHub
parent b081dffa92
commit c9be2ecca1
3 changed files with 12 additions and 5 deletions

View File

@@ -12,6 +12,7 @@
- Fix: [#19210] The load/save window executes the loading code twice, resulting in a slowdown. - Fix: [#19210] The load/save window executes the loading code twice, resulting in a slowdown.
- Fix: [#22056] Potential crash upon exiting the game. - Fix: [#22056] Potential crash upon exiting the game.
- Fix: [#22208] Cursor may fail to register hits in some cases (original bug). - Fix: [#22208] Cursor may fail to register hits in some cases (original bug).
- Fix: [#22284] Unrated rides cause high amount of nausea.
- Fix: [#22304] Graphs don't draw lines on the left edge of the screen. - Fix: [#22304] Graphs don't draw lines on the left edge of the screen.
- Fix: [#22318] Water sparkles are missing if transparent water is enabled without RCT1 linked. - Fix: [#22318] Water sparkles are missing if transparent water is enabled without RCT1 linked.

View File

@@ -22,6 +22,7 @@
#include <openrct2/interface/Colour.h> #include <openrct2/interface/Colour.h>
#include <openrct2/localisation/Formatter.h> #include <openrct2/localisation/Formatter.h>
#include <openrct2/network/network.h> #include <openrct2/network/network.h>
#include <openrct2/ride/RideRatings.h>
#include <openrct2/sprites.h> #include <openrct2/sprites.h>
#include <openrct2/util/Util.h> #include <openrct2/util/Util.h>
#include <openrct2/windows/Intent.h> #include <openrct2/windows/Intent.h>
@@ -914,17 +915,24 @@ static Widget _rideListWidgets[] = {
break; break;
case INFORMATION_TYPE_EXCITEMENT: case INFORMATION_TYPE_EXCITEMENT:
SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool {
return thisRide.ratings.excitement <= otherRide.ratings.excitement; const auto leftValue = thisRide.ratings.isNull() ? kRideRatingUndefined : thisRide.ratings.excitement;
const auto rightValue = otherRide.ratings.isNull() ? kRideRatingUndefined
: otherRide.ratings.excitement;
return leftValue <= rightValue;
}); });
break; break;
case INFORMATION_TYPE_INTENSITY: case INFORMATION_TYPE_INTENSITY:
SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool {
return thisRide.ratings.intensity <= otherRide.ratings.intensity; const auto leftValue = thisRide.ratings.isNull() ? kRideRatingUndefined : thisRide.ratings.intensity;
const auto rightValue = otherRide.ratings.isNull() ? kRideRatingUndefined : otherRide.ratings.intensity;
return leftValue <= rightValue;
}); });
break; break;
case INFORMATION_TYPE_NAUSEA: case INFORMATION_TYPE_NAUSEA:
SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool {
return thisRide.ratings.nausea <= otherRide.ratings.nausea; const auto leftValue = thisRide.ratings.isNull() ? kRideRatingUndefined : thisRide.ratings.nausea;
const auto rightValue = otherRide.ratings.isNull() ? kRideRatingUndefined : otherRide.ratings.nausea;
return leftValue <= rightValue;
}); });
break; break;
} }

View File

@@ -2268,6 +2268,4 @@ bool RatingTuple::isNull() const
void RatingTuple::setNull() void RatingTuple::setNull()
{ {
excitement = kRideRatingUndefined; excitement = kRideRatingUndefined;
intensity = kRideRatingUndefined;
nausea = kRideRatingUndefined;
} }