1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 11:33:03 +01:00

Use vector over initializer_list on FixLandOwnershipTilesWithOwnership

This commit is contained in:
Tulio Leao
2024-01-21 08:19:40 -03:00
parent 194a63c7dc
commit fe69dbb2ea
2 changed files with 4 additions and 5 deletions

View File

@@ -2200,11 +2200,11 @@ uint16_t CheckMaxAllowableLandRightsForTile(const CoordsXYZ& tileMapPos)
return destOwnership;
}
void FixLandOwnershipTilesWithOwnership(std::initializer_list<TileCoordsXY> tiles, uint8_t ownership, bool doNotDowngrade)
void FixLandOwnershipTilesWithOwnership(std::vector<TileCoordsXY> 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)

View File

@@ -232,7 +232,6 @@ bool MapIsLocationAtEdge(const CoordsXY& loc);
uint16_t CheckMaxAllowableLandRightsForTile(const CoordsXYZ& tileMapPos);
void FixLandOwnershipTilesWithOwnership(
std::initializer_list<TileCoordsXY> tiles, uint8_t ownership, bool doNotDowngrade = false);
void FixLandOwnershipTilesWithOwnership(std::vector<TileCoordsXY> tiles, uint8_t ownership, bool doNotDowngrade = false);
MapRange ClampRangeWithinMap(const MapRange& range);
void ShiftMap(const TileCoordsXY& amount);