1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 12:33:17 +01:00

fix ride_get_station_start_track_element

This commit is contained in:
IntelOrca
2014-10-31 02:37:28 +00:00
parent 7e17f4fcf9
commit 7f7c380bd6

View File

@@ -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++;