From d0bb8597d9d2b49aa5309e474f4fbafd990c8df1 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Wed, 3 Aug 2016 09:03:48 +0200 Subject: [PATCH] Use RideProperties --- src/ride/ride.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/ride/ride.c b/src/ride/ride.c index d348bdfbe6..d641310726 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -3758,8 +3758,8 @@ static bool ride_is_valid_num_circuits(rct_ride *ride, int numCircuits) static bool ride_is_valid_operation_option(rct_ride *ride, uint8 value) { - uint8 minValue = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8) + 4, uint8); - uint8 maxValue = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8) + 5, uint8); + uint8 minValue = RideProperties[ride->type].min_value; + uint8 maxValue = RideProperties[ride->type].max_value; if (ride->mode == RIDE_MODE_MAZE) { // Allow 64 people in mazes under non-cheat settings. The old maximum of 16 was too little for even moderately big mazes. maxValue = 64; @@ -5460,7 +5460,7 @@ void game_command_set_ride_status(int *eax, int *ebx, int *ecx, int *edx, int *e *ebx = MONEY32_UNDEFINED; return; } - RCT2_GLOBAL(0x00F43484, uint32) = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8), uint32); + RCT2_GLOBAL(0x00F43484, uint32) = RideProperties[ride->type].flags; if (*ebx & GAME_COMMAND_FLAG_APPLY) { if (ride->overall_view != (uint16)-1) { @@ -6048,12 +6048,8 @@ foundRideEntry: } ride->music = RCT2_ADDRESS(0x0097D4F4, uint8)[ride->type * 8]; - ride->operation_option = ( - RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) + - RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) + - RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) + - RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 5 + (ride->type * 8), uint8) - ) / 4; + const rct_ride_properties rideProperties = RideProperties[ride->type]; + ride->operation_option = (rideProperties.min_value * 3 + rideProperties.max_value) / 4; ride->lift_hill_speed = RideLiftData[ride->type].minimum_speed; @@ -6676,7 +6672,7 @@ void game_command_set_ride_price(int *eax, int *ebx, int *ecx, int *edx, int *es bool ride_type_has_flag(int rideType, int flag) { - return (RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (rideType * 8), uint32) & flag) != 0; + return (RideProperties[rideType].flags & flag) != 0; } /*