mirror of https://github.com/OpenRCT2/OpenRCT2.git
Make sure height comparisons are done against TileCoords
This commit is contained in:
parent
68e0519c5e
commit
43366a0a51
|
@ -6917,6 +6917,7 @@ void sub_6CB945(Ride* ride)
|
||||||
|
|
||||||
CoordsXYZ location = { ride->stations[stationId].Start.x * 32, ride->stations[stationId].Start.y * 32,
|
CoordsXYZ location = { ride->stations[stationId].Start.x * 32, ride->stations[stationId].Start.y * 32,
|
||||||
ride->stations[stationId].Height * 8 };
|
ride->stations[stationId].Height * 8 };
|
||||||
|
auto tileHeight = TileCoordsXYZ(location).z;
|
||||||
uint8_t direction = 0xFF;
|
uint8_t direction = 0xFF;
|
||||||
|
|
||||||
bool specialTrack = false;
|
bool specialTrack = false;
|
||||||
|
@ -6936,7 +6937,7 @@ void sub_6CB945(Ride* ride)
|
||||||
bool trackFound = false;
|
bool trackFound = false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (tileElement->base_height != location.z)
|
if (tileElement->base_height != tileHeight)
|
||||||
continue;
|
continue;
|
||||||
if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK)
|
if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK)
|
||||||
continue;
|
continue;
|
||||||
|
@ -6975,6 +6976,7 @@ void sub_6CB945(Ride* ride)
|
||||||
while ((++trackBlock)->index != 0xFF)
|
while ((++trackBlock)->index != 0xFF)
|
||||||
{
|
{
|
||||||
CoordsXYZ blockLocation = location + CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(direction), 0 };
|
CoordsXYZ blockLocation = location + CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(direction), 0 };
|
||||||
|
auto blockTileHeight = TileCoordsXYZ(blockLocation).z;
|
||||||
|
|
||||||
bool trackFound = false;
|
bool trackFound = false;
|
||||||
tileElement = map_get_first_element_at(blockLocation.x >> 5, blockLocation.y >> 5);
|
tileElement = map_get_first_element_at(blockLocation.x >> 5, blockLocation.y >> 5);
|
||||||
|
@ -6982,7 +6984,7 @@ void sub_6CB945(Ride* ride)
|
||||||
break;
|
break;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (blockLocation.z != tileElement->base_height)
|
if (blockTileHeight != tileElement->base_height)
|
||||||
continue;
|
continue;
|
||||||
if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK)
|
if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue