Refactor number values to RIDE_VALUE_UNDEFINED

This commit is contained in:
Matt 2019-01-30 14:59:06 +01:00
parent 6668a1fa86
commit 7ad59bbb37
2 changed files with 5 additions and 4 deletions

View File

@ -266,7 +266,7 @@ public:
}
std::fill(std::begin(ride->num_customers), std::end(ride->num_customers), 0);
ride->value = 0xFFFF;
ride->value = RIDE_VALUE_UNDEFINED;
ride->satisfaction = 255;
ride->satisfaction_time_out = 0;
ride->satisfaction_next = 0;

View File

@ -1724,7 +1724,7 @@ bool rct_peep::ShouldGoOnRide(ride_id_t rideIndex, int32_t entranceNum, bool atQ
{
// Peeps that are leaving the park will refuse to go on any rides, with the exception of free transport rides.
assert(ride->type < std::size(RideData4));
if (!(RideData4[ride->type].flags & RIDE_TYPE_FLAG4_TRANSPORT_RIDE) || ride->value == 0xFFFF
if (!(RideData4[ride->type].flags & RIDE_TYPE_FLAG4_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|| ride_get_price(ride) != 0)
{
if (peep_flags & PEEP_FLAGS_LEAVING_PARK)
@ -1793,7 +1793,8 @@ bool rct_peep::ShouldGoOnRide(ride_id_t rideIndex, int32_t entranceNum, bool atQ
// Assuming the queue conditions are met, peeps will always go on free transport rides.
// Ride ratings, recent crashes and weather will all be ignored.
money16 ridePrice = ride_get_price(ride);
if (!(RideData4[ride->type].flags & RIDE_TYPE_FLAG4_TRANSPORT_RIDE) || ride->value == 0xFFFF || ridePrice != 0)
if (!(RideData4[ride->type].flags & RIDE_TYPE_FLAG4_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|| ridePrice != 0)
{
if (previous_ride == rideIndex)
{
@ -2500,7 +2501,7 @@ static int16_t peep_calculate_ride_value_satisfaction(rct_peep* peep, Ride* ride
return -30;
}
if (ride->value == 0xFFFF)
if (ride->value == RIDE_VALUE_UNDEFINED)
{
return -30;
}