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

Function NeighbourIsNormal

src/clear_cmd.cpp:223–232  ·  view source on GitHub ↗

* Tests if at least one surrounding tile is non-desert * @param tile tile to check * @return does this tile have at least one non-desert tile around? */

Source from the content-addressed store, hash-verified

221 * @return does this tile have at least one non-desert tile around?
222 */
223static inline bool NeighbourIsNormal(TileIndex tile)
224{
225 for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) {
226 TileIndex t = tile + TileOffsByDiagDir(dir);
227 if (!IsValidTile(t)) continue;
228 if (GetTropicZone(t) != TROPICZONE_DESERT) return true;
229 if (HasTileWaterClass(t) && GetWaterClass(t) == WaterClass::Sea) return true;
230 }
231 return false;
232}
233
234static void TileLoopClearDesert(TileIndex tile)
235{

Callers 1

TileLoopClearDesertFunction · 0.85

Calls 5

TileOffsByDiagDirFunction · 0.85
IsValidTileFunction · 0.85
GetTropicZoneFunction · 0.85
HasTileWaterClassFunction · 0.85
GetWaterClassFunction · 0.85

Tested by

no test coverage detected