mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-25 08:22:17 +00:00
Change: Make ScriptTile::IsBuildableRectangle use a TileArea for iteration
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user