mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 08:12:53 +01:00
Make Map::map_get_track_element_at_from_ride() use CoordsXYZ
This commit is contained in:
@@ -2435,7 +2435,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, Ride* ride)
|
||||
CoordsXYE input;
|
||||
input.x = stationPosition.x * 32;
|
||||
input.y = stationPosition.y * 32;
|
||||
input.element = map_get_track_element_at_from_ride(input.x, input.y, stationZ, current_ride);
|
||||
input.element = map_get_track_element_at_from_ride({ input.x, input.y, stationZ << 3 }, current_ride);
|
||||
if (input.element == nullptr)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -2288,16 +2288,17 @@ TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPo
|
||||
* @param y y units, not tiles.
|
||||
* @param z Base height.
|
||||
*/
|
||||
TileElement* map_get_track_element_at_from_ride(int32_t x, int32_t y, int32_t z, ride_id_t rideIndex)
|
||||
TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_id_t rideIndex)
|
||||
{
|
||||
TileElement* tileElement = map_get_first_element_at({ x, y });
|
||||
TileElement* tileElement = map_get_first_element_at(trackPos);
|
||||
if (tileElement == nullptr)
|
||||
return nullptr;
|
||||
auto trackTilePos = TileCoordsXYZ{ trackPos };
|
||||
do
|
||||
{
|
||||
if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK)
|
||||
continue;
|
||||
if (tileElement->base_height != z)
|
||||
if (tileElement->base_height != trackTilePos.z)
|
||||
continue;
|
||||
if (tileElement->AsTrack()->GetRideIndex() != rideIndex)
|
||||
continue;
|
||||
|
||||
@@ -235,7 +235,7 @@ TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, int
|
||||
TrackElement* map_get_track_element_at_of_type(CoordsXYZD location, int32_t trackType);
|
||||
TrackElement* map_get_track_element_at_of_type_seq(CoordsXYZD location, int32_t trackType, int32_t sequence);
|
||||
TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, int32_t trackType, ride_id_t rideIndex);
|
||||
TileElement* map_get_track_element_at_from_ride(int32_t x, int32_t y, int32_t z, ride_id_t rideIndex);
|
||||
TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_id_t rideIndex);
|
||||
TileElement* map_get_track_element_at_with_direction_from_ride(
|
||||
int32_t x, int32_t y, int32_t z, int32_t direction, ride_id_t rideIndex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user