Change: Make ScriptTile::IsBuildableRectangle use a TileArea for iteration

This commit is contained in:
Abigail
2026-04-04 16:15:40 +02:00
committed by rubidium42
parent 34f5f1eaea
commit 4355855b85
+2 -7
View File
@@ -50,13 +50,8 @@
/* Check whether we can extract valid X and Y */
if (!::IsValidTile(tile) || width < 1 || height < 1) return false;
uint tx = ScriptMap::GetTileX(tile);
uint ty = ScriptMap::GetTileY(tile);
for (uint x = tx; x < width + tx; x++) {
for (uint y = ty; y < height + ty; y++) {
if (!IsBuildable(ScriptMap::GetTileIndex(x, y))) return false;
}
for (auto cur_tile : TileArea(tile, width, height)) {
if (!IsBuildable(cur_tile)) return false;
}
return true;