MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IsInnerTile

Function IsInnerTile

src/tile_map.h:109–117  ·  view source on GitHub ↗

* Check if a tile is within the map (not a border) * * @param tile The tile to check * @return Whether the tile is in the interior of the map * @pre tile < Map::Size() */

Source from the content-addressed store, hash-verified

107 * @pre tile < Map::Size()
108 */
109inline bool IsInnerTile(Tile tile)
110{
111 assert(tile < Map::Size());
112
113 uint x = TileX(tile);
114 uint y = TileY(tile);
115
116 return x < Map::MaxX() && y < Map::MaxY() && ((x > 0 && y > 0) || !_settings_game.construction.freeform_edges);
117}
118
119/**
120 * Set the type of a tile

Callers 4

SetTileTypeFunction · 0.85
GreyscaleToMapHeightsFunction · 0.85
FixSlopesFunction · 0.85
TgenSetTileHeightFunction · 0.85

Calls 2

TileXFunction · 0.85
TileYFunction · 0.85

Tested by

no test coverage detected