From d5f374d38c931395dc5786e6261a391790867ecb Mon Sep 17 00:00:00 2001 From: lnz Date: Fri, 30 May 2014 00:24:44 +0200 Subject: [PATCH] Fix station_heights bug and use FOR_ALL_RIDES in ride_check_all_reachable --- src/ride.c | 9 +++------ src/ride.h | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ride.c b/src/ride.c index 840d12abf9..c7746e91f9 100644 --- a/src/ride.c +++ b/src/ride.c @@ -328,11 +328,9 @@ void ride_shop_connected(rct_ride* ride, int ride_idx) void ride_check_all_reachable() { rct_ride *ride; - - for (int i = 0; i < MAX_RIDES; i++) { - ride = GET_RIDE(i); - if (ride->type == RIDE_TYPE_NULL) - continue; + int i; + + FOR_ALL_RIDES(i, ride) { if (ride->connected_message_throttle != 0) ride->connected_message_throttle--; if (ride->status != RIDE_STATUS_OPEN || ride->connected_message_throttle != 0) @@ -342,7 +340,6 @@ void ride_check_all_reachable() ride_shop_connected(ride, i); else ride_entrance_exit_connected(ride, i); - } } diff --git a/src/ride.h b/src/ride.h index 9f593c1ec5..bcbc0c86dd 100644 --- a/src/ride.h +++ b/src/ride.h @@ -56,8 +56,8 @@ typedef struct { uint32 var_04C; uint16 overall_view; // 0x050 uint16 station_starts[4]; // 0x052 - uint16 station_heights[4]; // 0x05A - uint8 pad_062[8]; + uint8 station_heights[4]; // 0x05A + uint8 pad_05E[0xC]; uint16 entrances[4]; // 0x06A uint16 exits[4]; // 0x072 uint8 pad_07A[0x0C];