* Clears all elements properly from a certain tile. * rct2: 0x0068AE2A */
| 1479 | * rct2: 0x0068AE2A |
| 1480 | */ |
| 1481 | static void ClearElementsAt(const CoordsXY& loc) |
| 1482 | { |
| 1483 | auto& gameState = getGameState(); |
| 1484 | // Remove the spawn point (if there is one in the current tile) |
| 1485 | gameState.peepSpawns.erase( |
| 1486 | std::remove_if( |
| 1487 | gameState.peepSpawns.begin(), gameState.peepSpawns.end(), |
| 1488 | [loc](const CoordsXY& spawn) { return spawn.ToTileStart() == loc.ToTileStart(); }), |
| 1489 | gameState.peepSpawns.end()); |
| 1490 | |
| 1491 | TileElement* tileElement = MapGetFirstElementAt(loc); |
| 1492 | if (tileElement == nullptr) |
| 1493 | return; |
| 1494 | |
| 1495 | // Remove all elements except the last one |
| 1496 | while (!tileElement->isLastForTile()) |
| 1497 | ClearElementAt(loc, &tileElement); |
| 1498 | |
| 1499 | // Remove the last element |
| 1500 | ClearElementAt(loc, &tileElement); |
| 1501 | } |
| 1502 | |
| 1503 | int32_t MapGetHighestZ(const CoordsXY& loc) |
| 1504 | { |
no test coverage detected