| 2029 | } |
| 2030 | |
| 2031 | TileElement* MapGetTrackElementAtBeforeSurfaceFromRide(const CoordsXYZ& trackPos, const RideId rideIndex) |
| 2032 | { |
| 2033 | TileElement* tileElement = MapGetFirstElementAt(trackPos); |
| 2034 | if (tileElement == nullptr) |
| 2035 | return nullptr; |
| 2036 | |
| 2037 | do |
| 2038 | { |
| 2039 | if (tileElement->getType() == TileElementType::Surface) |
| 2040 | { |
| 2041 | return nullptr; |
| 2042 | } |
| 2043 | |
| 2044 | if (tileElement->getType() == TileElementType::Track && tileElement->getBaseZ() == trackPos.z |
| 2045 | && tileElement->asTrack()->GetRideIndex() == rideIndex) |
| 2046 | { |
| 2047 | return tileElement; |
| 2048 | } |
| 2049 | } while (!(tileElement++)->isLastForTile()); |
| 2050 | |
| 2051 | return nullptr; |
| 2052 | } |
| 2053 | |
| 2054 | /** |
| 2055 | * Gets the track element at x, y, z that is the given track type and sequence. |
no test coverage detected