mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Make Map::map_get_track_element_at_with_direction_from_ride() use CoordsXYZD
This commit is contained in:
@@ -807,7 +807,8 @@ bool track_remove_station_element(int32_t x, int32_t y, int32_t z, int32_t direc
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_3))
|
||||
{
|
||||
TileElement* tileElement = map_get_track_element_at_with_direction_from_ride(x, y, z, direction, rideIndex);
|
||||
TileElement* tileElement = map_get_track_element_at_with_direction_from_ride(
|
||||
{ x, y, z << 3, static_cast<Direction>(direction) }, rideIndex);
|
||||
if (tileElement != nullptr)
|
||||
{
|
||||
if (flags & GAME_COMMAND_FLAG_APPLY)
|
||||
|
||||
@@ -2316,21 +2316,21 @@ TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_
|
||||
* @param z Base height.
|
||||
* @param direction The direction (0 - 3).
|
||||
*/
|
||||
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)
|
||||
TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& 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;
|
||||
if (tileElement->GetDirection() != direction)
|
||||
if (tileElement->GetDirection() != trackPos.direction)
|
||||
continue;
|
||||
|
||||
return tileElement;
|
||||
|
||||
@@ -236,8 +236,7 @@ TrackElement* map_get_track_element_at_of_type(CoordsXYZD location, int32_t trac
|
||||
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(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);
|
||||
TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, ride_id_t rideIndex);
|
||||
|
||||
bool map_is_location_at_edge(const CoordsXY& loc);
|
||||
void map_obstruction_set_error_text(TileElement* tileElement);
|
||||
|
||||
Reference in New Issue
Block a user