Jump to content

Message: entrance fee is too high -> Admission price: Free!


Recommended Posts

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?

 

fee_too_high.jpg

oli027-020.zip

  • Informative 1
Link to comment
  • 4 weeks later...

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

  • Useful 1
Link to comment
  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...