MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / MapGetRideExitElementAt

Function MapGetRideExitElementAt

src/openrct2/world/Map.cpp:1597–1621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1595 }
1596
1597 EntranceElement* MapGetRideExitElementAt(const CoordsXYZ& exitCoords, bool ghost)
1598 {
1599 auto exitTileCoords = TileCoordsXYZ{ exitCoords };
1600 TileElement* tileElement = MapGetFirstElementAt(exitCoords);
1601 if (tileElement != nullptr)
1602 {
1603 do
1604 {
1605 if (tileElement->getType() != TileElementType::Entrance)
1606 continue;
1607
1608 if (tileElement->baseHeight != exitTileCoords.z)
1609 continue;
1610
1611 if (tileElement->asEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_EXIT)
1612 continue;
1613
1614 if (!ghost && tileElement->isGhost())
1615 continue;
1616
1617 return tileElement->asEntrance();
1618 } while (!(tileElement++)->isLastForTile());
1619 }
1620 return nullptr;
1621 }
1622
1623 SmallSceneryElement* MapGetSmallSceneryElementAt(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant)
1624 {

Callers 3

TEST_FFunction · 0.85
SwapRideEntranceAndExitFunction · 0.85

Calls 6

MapGetFirstElementAtFunction · 0.85
getTypeMethod · 0.45
GetEntranceTypeMethod · 0.45
asEntranceMethod · 0.45
isGhostMethod · 0.45
isLastForTileMethod · 0.45

Tested by 1

TEST_FFunction · 0.68