PanoOli Posted January 4, 2023 Share Posted January 4, 2023 I have a problem white a bigger Park. Message: "your park entrance fee is too high" Admission price: "Free" -> I can't reduce anything here! The effect is that the number of visitors is falling sharply. What can I do to eliminate this message and prevent the large number of guests from leaving? Or is that a bug? oli027-020.zip 1 Link to comment
jensj12 Posted January 5, 2023 Share Posted January 5, 2023 What is the admission price if you (temporarily) enable 'pay for entry' in the cheats or scenario options? Link to comment
PanoOli Posted January 6, 2023 Author Share Posted January 6, 2023 17 hours ago, jensj12 said: What is the admission price if you (temporarily) enable 'pay for entry' in the cheats or scenario options? it is 0€ a change to 1€ doesn't change anything this problem Link to comment
PanoOli Posted January 30, 2023 Author Share Posted January 30, 2023 Other Park, the same problem:-( I think I've identified the problem: --- Scenario.cpp --- static void scenario_entrance_fee_too_high_check() { const auto max_fee = add_clamp_money16(gTotalRideValueForMoney, gTotalRideValueForMoney / 2); if ((gParkFlags & PARK_FLAGS_PARK_OPEN) && ParkGetEntranceFee() > max_fee) { ... News::AddItemToQueue(News::ItemType::Blank, STR_ENTRANCE_FEE_TOO_HI, packed_xy, {}); --- other .cpp/.h --- money16 gTotalRideValueForMoney; using money16 = fixed16_1dp; using fixed16_1dp = int16_t; INT16_MAX = 32767; --- Viewing these Variables with scrip: ok 'park.totalRideValueForMoney: 32328' 'park.entranceFee: 0' with problems 'park.totalRideValueForMoney: -32730' 'park.entranceFee: 0' --- The 16-Bit signed variable "gTotalRideValueForMoney" has an overflow and makes a wrap to negative! This value is using not only for message "ENTRANCE_FEE_TOO_HI", other functions for rating(?) use this... Manual addition of all rides = 32806 (see ride_all.xlsx) => b 10000000 00100110 => -32730 sumery of 641 from 1000 (rideCount /OpenRCT2::Limits::MaxRidesInPark) Suggestion for quick fix: --- Ride.cpp --- uint16_t value; --- Park.cpp --- gTotalRideValueForMoney = CalculateTotalRideValueForMoney(); ... money16 Park::CalculateTotalRideValueForMoney() const { money16 totalRideValue = 0; => int32_t totalRideValue = 0; bool ridePricesUnlocked = ParkRidePricesUnlocked() && !(gParkFlags & PARK_FLAGS_NO_MONEY); for (auto& ride : GetRideManager()) { if (ride.status != RideStatus::Open) continue; if (ride.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) continue; if (ride.lifecycle_flags & RIDE_LIFECYCLE_CRASHED) continue; // Add ride value if (ride.value != RIDE_VALUE_UNDEFINED) { money16 rideValue = static_cast<money16>(ride.value); => int32_t rideValue = static_cast<int32_t>(ride.value); if (ridePricesUnlocked) { rideValue -= ride.price[0]; } if (rideValue > 0) { totalRideValue += rideValue * 2; } } } // saturation result to int16 if (totalRideValue <= INT16_MAX) return static_cast<money16>(totalRideValue); else return INT16_MAX; } --- Maybe someone who is allowed to edit code can take care of this problem? ride_all.xlsx t010-124-error.park 1 Link to comment
jensj12 Posted January 30, 2023 Share Posted January 30, 2023 Thanks for the detailed investigation. I've reported it here: #19292 Link to comment
jensj12 Posted February 13, 2023 Share Posted February 13, 2023 The issue has been fixed (by using 64-bit total ride value instead of 16-bit). Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now