mirror of https://github.com/OpenTTD/OpenTTD
(svn r18937) -Fix (r15190): TileAddWrap didn't return INVALID_TILE for void tiles at the north border
parent
8ee96d4d45
commit
6be4560528
|
@ -115,9 +115,11 @@ TileIndex TileAddWrap(TileIndex tile, int addx, int addy)
|
||||||
uint x = TileX(tile) + addx;
|
uint x = TileX(tile) + addx;
|
||||||
uint y = TileY(tile) + addy;
|
uint y = TileY(tile) + addy;
|
||||||
|
|
||||||
|
/* Disallow void tiles at the north border. */
|
||||||
|
if (_settings_game.construction.freeform_edges && (x == 0 || y == 0)) return INVALID_TILE;
|
||||||
|
|
||||||
/* Are we about to wrap? */
|
/* Are we about to wrap? */
|
||||||
if (x < MapMaxX() && y < MapMaxY())
|
if (x < MapMaxX() && y < MapMaxY()) return tile + TileDiffXY(addx, addy);
|
||||||
return tile + TileDiffXY(addx, addy);
|
|
||||||
|
|
||||||
return INVALID_TILE;
|
return INVALID_TILE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue