diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index f984d4b84f..a2038a1a5d 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -2200,11 +2200,11 @@ uint16_t CheckMaxAllowableLandRightsForTile(const CoordsXYZ& tileMapPos) return destOwnership; } -void FixLandOwnershipTilesWithOwnership(std::initializer_list tiles, uint8_t ownership, bool doNotDowngrade) +void FixLandOwnershipTilesWithOwnership(std::vector tiles, uint8_t ownership, bool doNotDowngrade) { - for (const TileCoordsXY* tile = tiles.begin(); tile != tiles.end(); ++tile) + for (const auto& tile : tiles) { - auto surfaceElement = MapGetSurfaceElementAt(*tile); + auto surfaceElement = MapGetSurfaceElementAt(tile); if (surfaceElement != nullptr) { if (doNotDowngrade && surfaceElement->GetOwnership() == OWNERSHIP_OWNED) diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 06bde7c5b9..2f4e75f033 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -232,7 +232,6 @@ bool MapIsLocationAtEdge(const CoordsXY& loc); uint16_t CheckMaxAllowableLandRightsForTile(const CoordsXYZ& tileMapPos); -void FixLandOwnershipTilesWithOwnership( - std::initializer_list tiles, uint8_t ownership, bool doNotDowngrade = false); +void FixLandOwnershipTilesWithOwnership(std::vector tiles, uint8_t ownership, bool doNotDowngrade = false); MapRange ClampRangeWithinMap(const MapRange& range); void ShiftMap(const TileCoordsXY& amount);