mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 12:03:07 +01:00
Guests with umbrellas no longer always avoid Maze when it rains (#16859)
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
@@ -2053,9 +2053,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, StationIndex entranceNum, bool atQueue, b
|
||||
}
|
||||
}
|
||||
|
||||
// Peeps won't go on rides that aren't sufficiently undercover while it's raining.
|
||||
// The threshold is fairly low and only requires about 10-15% of the ride to be undercover.
|
||||
if (climate_is_raining() && (ride->sheltered_eighths) < 3)
|
||||
if (climate_is_raining() && !ShouldRideWhileRaining(*ride))
|
||||
{
|
||||
if (peepAtRide)
|
||||
{
|
||||
@@ -2348,6 +2346,25 @@ int32_t Guest::GetParkEntryTime() const
|
||||
return ParkEntryTime;
|
||||
}
|
||||
|
||||
bool Guest::ShouldRideWhileRaining(const Ride& ride)
|
||||
{
|
||||
// Peeps will go on rides that are sufficiently undercover while it's raining.
|
||||
// The threshold is fairly low and only requires about 10-15% of the ride to be undercover.
|
||||
if (ride.sheltered_eighths >= 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Peeps with umbrellas will go on rides where they can use their umbrella on it (like the Maze) 50% of the time
|
||||
if (HasItem(ShopItem::Umbrella) && ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_PEEP_CAN_USE_UMBRELLA)
|
||||
&& (scenario_rand() & 2) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Guest::ChoseNotToGoOnRide(Ride* ride, bool peepAtRide, bool updateLastRide)
|
||||
{
|
||||
if (peepAtRide && updateLastRide)
|
||||
@@ -4807,7 +4824,7 @@ void Guest::UpdateRideMazePathfinding()
|
||||
|
||||
if (IsActionInterruptable())
|
||||
{
|
||||
if (Energy > 64 && (scenario_rand() & 0xFFFF) <= 2427)
|
||||
if (Energy > 64 && (scenario_rand() & 0xFFFF) <= 2427 && !climate_is_raining())
|
||||
{
|
||||
Action = PeepActionType::Jump;
|
||||
ActionFrame = 0;
|
||||
|
||||
@@ -332,6 +332,7 @@ public:
|
||||
bool HeadingForRideOrParkExit() const;
|
||||
void StopPurchaseThought(uint8_t ride_type);
|
||||
void TryGetUpFromSitting();
|
||||
bool ShouldRideWhileRaining(const Ride& ride);
|
||||
void ChoseNotToGoOnRide(Ride* ride, bool peepAtRide, bool updateLastRide);
|
||||
void PickRideToGoOn();
|
||||
void ReadMap();
|
||||
|
||||
@@ -275,6 +275,7 @@ enum ride_type_flags : uint64_t
|
||||
RIDE_TYPE_FLAG_IS_SUSPENDED = (1ULL << 50),
|
||||
RIDE_TYPE_FLAG_HAS_LANDSCAPE_DOORS = (1ULL << 51),
|
||||
RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT = (1ULL << 52),
|
||||
RIDE_TYPE_FLAG_PEEP_CAN_USE_UMBRELLA = (1ULL << 53),
|
||||
};
|
||||
|
||||
// Set on ride types that have a main colour, additional colour and support colour.
|
||||
|
||||
@@ -25,7 +25,8 @@ constexpr const RideTypeDescriptor MazeRTD =
|
||||
SET_FIELD(StartTrackPiece, TrackElemType::Maze),
|
||||
SET_FIELD(TrackPaintFunction, get_track_paint_function_maze),
|
||||
SET_FIELD(Flags, RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS | RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_NO_TEST_MODE | RIDE_TYPE_FLAG_NO_VEHICLES |
|
||||
RIDE_TYPE_FLAG_TRACK_NO_WALLS | RIDE_TYPE_FLAG_IN_RIDE | RIDE_TYPE_FLAG_HAS_TRACK | RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT | RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY),
|
||||
RIDE_TYPE_FLAG_TRACK_NO_WALLS | RIDE_TYPE_FLAG_IN_RIDE | RIDE_TYPE_FLAG_HAS_TRACK | RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT | RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY |
|
||||
RIDE_TYPE_FLAG_PEEP_CAN_USE_UMBRELLA),
|
||||
SET_FIELD(RideModes, EnumsToFlags(RideMode::Maze)),
|
||||
SET_FIELD(DefaultMode, RideMode::Maze),
|
||||
SET_FIELD(OperatingSettings, { 1, 64, 0, 0, 0, 0 }),
|
||||
|
||||
Reference in New Issue
Block a user