mirror of https://github.com/OpenTTD/OpenTTD
(svn r25815) -Fix [FS#5754]: ScriptTile::IsBuildableRectangle could report true for tiles outside of the map, if they happened to wrap around into a valid area. (Bolt)
parent
3e8d498bc5
commit
f26aad2e84
|
@ -43,10 +43,11 @@
|
||||||
|
|
||||||
/* static */ bool ScriptTile::IsBuildableRectangle(TileIndex tile, uint width, uint height)
|
/* static */ bool ScriptTile::IsBuildableRectangle(TileIndex tile, uint width, uint height)
|
||||||
{
|
{
|
||||||
uint tx, ty;
|
/* Check whether we can extract valid X and Y */
|
||||||
|
if (!::IsValidTile(tile)) return false;
|
||||||
|
|
||||||
tx = ScriptMap::GetTileX(tile);
|
uint tx = ScriptMap::GetTileX(tile);
|
||||||
ty = ScriptMap::GetTileY(tile);
|
uint ty = ScriptMap::GetTileY(tile);
|
||||||
|
|
||||||
for (uint x = tx; x < width + tx; x++) {
|
for (uint x = tx; x < width + tx; x++) {
|
||||||
for (uint y = ty; y < height + ty; y++) {
|
for (uint y = ty; y < height + ty; y++) {
|
||||||
|
|
Loading…
Reference in New Issue