Merge pull request #8656 from ZehMatt/refactor-constants-1

Refactor more constants
This commit is contained in:
ζeh Matt 2019-01-30 16:00:19 +01:00 committed by GitHub
commit ec13e8db09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 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;
}

View File

@ -6304,7 +6304,7 @@ static int32_t vehicle_update_motion_dodgems(rct_vehicle* vehicle)
}
}
uint16_t collideSprite = 0xFFFF;
uint16_t collideSprite = SPRITE_INDEX_NULL;
if (vehicle->dodgems_collision_direction != 0)
{
@ -6367,7 +6367,7 @@ static int32_t vehicle_update_motion_dodgems(rct_vehicle* vehicle)
vehicle->velocity = 0;
uint8_t direction = vehicle->sprite_direction | 1;
if (collideSprite != 0xFFFF)
if (collideSprite != SPRITE_INDEX_NULL)
{
vehicle->var_34 = (scenario_rand() & 1) ? 1 : -1;