From 7f7c380bd6981d2bf1f0da9b1b7bdde26fcb3161 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Fri, 31 Oct 2014 02:37:28 +0000 Subject: [PATCH] fix ride_get_station_start_track_element --- src/ride/ride.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ride/ride.c b/src/ride/ride.c index 3176fc8ac6..5e6d5f4148 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -218,16 +218,16 @@ rct_map_element *ride_get_station_start_track_element(rct_ride *ride, int statio int x, y, z; rct_map_element *mapElement; - x = (ride->station_starts[stationIndex] & 0xFF) * 32; - y = (ride->station_starts[stationIndex] >> 8) * 32; - z = ride->station_heights[stationIndex] * 8; + x = ride->station_starts[stationIndex] & 0xFF; + y = ride->station_starts[stationIndex] >> 8; + z = ride->station_heights[stationIndex]; // Get first element of the tile mapElement = TILE_MAP_ELEMENT_POINTER(y * 256 + x); // Find the station track element do { - if ((mapElement->type & MAP_ELEMENT_TYPE_MASK) == MAP_ELEMENT_TYPE_TRACK && x == mapElement->base_height) + if ((mapElement->type & MAP_ELEMENT_TYPE_MASK) == MAP_ELEMENT_TYPE_TRACK && z == mapElement->base_height) return mapElement; mapElement++;