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:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user