1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-02 11:45:13 +01:00

Fix #14667: Unpurchaseable land tiles in Extreme Hawaiian Island

This commit is contained in:
Michael Steenbeek
2021-08-01 17:26:43 +02:00
committed by GitHub
parent 654fb83d3c
commit 864de57877
4 changed files with 40 additions and 4 deletions

View File

@@ -2494,13 +2494,16 @@ void FixLandOwnershipTiles(std::initializer_list<TileCoordsXY> tiles)
FixLandOwnershipTilesWithOwnership(tiles, OWNERSHIP_AVAILABLE);
}
void FixLandOwnershipTilesWithOwnership(std::initializer_list<TileCoordsXY> tiles, uint8_t ownership)
void FixLandOwnershipTilesWithOwnership(std::initializer_list<TileCoordsXY> tiles, uint8_t ownership, bool doNotDowngrade)
{
for (const TileCoordsXY* tile = tiles.begin(); tile != tiles.end(); ++tile)
{
auto surfaceElement = map_get_surface_element_at(tile->ToCoordsXY());
if (surfaceElement != nullptr)
{
if (doNotDowngrade && surfaceElement->GetOwnership() == OWNERSHIP_OWNED)
continue;
surfaceElement->SetOwnership(ownership);
update_park_fences_around_tile({ (*tile).x * 32, (*tile).y * 32 });
}