* Gets the track element at x, y, z that is the given track type and sequence. * @param x x units, not tiles. * @param y y units, not tiles. * @param z Base height. * @param direction The direction (0 - 3). */
| 2059 | * @param direction The direction (0 - 3). |
| 2060 | */ |
| 2061 | TileElement* MapGetTrackElementAtWithDirectionFromRide(const CoordsXYZD& trackPos, RideId rideIndex) |
| 2062 | { |
| 2063 | TileElement* tileElement = MapGetFirstElementAt(trackPos); |
| 2064 | if (tileElement == nullptr) |
| 2065 | return nullptr; |
| 2066 | auto trackTilePos = TileCoordsXYZ{ trackPos }; |
| 2067 | do |
| 2068 | { |
| 2069 | if (tileElement->getType() != TileElementType::Track) |
| 2070 | continue; |
| 2071 | if (tileElement->baseHeight != trackTilePos.z) |
| 2072 | continue; |
| 2073 | if (tileElement->asTrack()->GetRideIndex() != rideIndex) |
| 2074 | continue; |
| 2075 | if (tileElement->getDirection() != trackPos.direction) |
| 2076 | continue; |
| 2077 | |
| 2078 | return tileElement; |
| 2079 | } while (!(tileElement++)->isLastForTile()); |
| 2080 | |
| 2081 | return nullptr; |
| 2082 | } |
| 2083 | |
| 2084 | WallElement* MapGetWallElementAt(const CoordsXYRangedZ& coords) |
| 2085 | { |
no test coverage detected