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

Method ClampToMap

src/tilearea.cpp:142–147  ·  view source on GitHub ↗

* Clamp the tile area to map borders. */

Source from the content-addressed store, hash-verified

140 * Clamp the tile area to map borders.
141 */
142void OrthogonalTileArea::ClampToMap()
143{
144 assert(this->tile < Map::Size());
145 this->w = std::min<int>(this->w, Map::SizeX() - TileX(this->tile));
146 this->h = std::min<int>(this->h, Map::SizeY() - TileY(this->tile));
147}
148
149/**
150 * Returns an iterator to the beginning of the tile area.

Callers 3

CommonRaiseLowerBigLandFunction · 0.80
PlantFarmFieldFunction · 0.80
DrawSmallMapColumnMethod · 0.80

Calls 2

TileXFunction · 0.85
TileYFunction · 0.85

Tested by

no test coverage detected