From c8c55002c8a41618204b9805d478566f69a61ecb Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Tue, 7 Apr 2015 18:44:55 +0100 Subject: [PATCH] Refactor with sheltered knowledge --- src/ride/ride.h | 5 +++-- src/ride/vehicle.c | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ride/ride.h b/src/ride/ride.h index 4307372de7..ce08dfe5b1 100644 --- a/src/ride/ride.h +++ b/src/ride/ride.h @@ -263,7 +263,8 @@ typedef struct { uint8 highest_drop_height; // 0x117 sint32 sheltered_length; // 0x118 uint16 var_11C; - uint8 num_sheltered_sections; // 0x11E + uint8 num_sheltered_sections; // 0x11E (?abY YYYY) + // z related to var_10C uint8 var_11F; sint16 var_120; sint16 var_122; @@ -477,7 +478,7 @@ enum { }; enum{ - RIDE_TESTING_FLAG_0 = (1 << 0), + RIDE_TESTING_SHELTERED = (1 << 0), RIDE_TESTING_TURN_LEFT = (1 << 1), RIDE_TESTING_TURN_RIGHT = (1 << 2), RIDE_TESTING_TURN_BANKED = (1 << 3), diff --git a/src/ride/vehicle.c b/src/ride/vehicle.c index e22f57415d..1fcfe9db53 100644 --- a/src/ride/vehicle.c +++ b/src/ride/vehicle.c @@ -742,7 +742,7 @@ static void vehicle_update_measurements(rct_vehicle *vehicle) y = vehicle->y; if (x == SPRITE_LOCATION_NULL){ - ride->testing_flags &= ~RIDE_TESTING_FLAG_0; + ride->testing_flags &= ~RIDE_TESTING_SHELTERED; return; } @@ -751,7 +751,7 @@ static void vehicle_update_measurements(rct_vehicle *vehicle) for (;; map_element++){ if (map_element_is_last_for_tile(map_element)){ - ride->testing_flags &= ~RIDE_TESTING_FLAG_0; + ride->testing_flags &= ~RIDE_TESTING_SHELTERED; return; } @@ -770,8 +770,8 @@ static void vehicle_update_measurements(rct_vehicle *vehicle) } } - if (!(ride->testing_flags & RIDE_TESTING_FLAG_0)){ - ride->testing_flags |= RIDE_TESTING_FLAG_0; + if (!(ride->testing_flags & RIDE_TESTING_SHELTERED)){ + ride->testing_flags |= RIDE_TESTING_SHELTERED; uint8 num_sheltered_sections = ride->num_sheltered_sections & 0x1F; if (num_sheltered_sections != 0x1F)