diff --git a/src/landscape.cpp b/src/landscape.cpp index 544a41876b..2f534d3194 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -992,7 +992,7 @@ static void CreateDesertOrRainForest(uint desert_tropic_line) */ static bool FindSpring(TileIndex tile, void *) { - int reference_height; + uint reference_height; if (!IsTileFlat(tile, &reference_height) || IsWaterTile(tile)) return false; /* In the tropics rivers start in the rainforest. */ diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index d4f28477b9..0eb06a8702 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -783,7 +783,7 @@ static bool TryBuildLightHouse() if (!IsTileType(tile, MP_WATER)) return false; for (int j = 0; j < 19; j++) { - int h; + uint h; if (IsTileType(tile, MP_CLEAR) && IsTileFlat(tile, &h) && h <= 2 && !IsBridgeAbove(tile)) { BuildObject(OBJECT_LIGHTHOUSE, tile); assert(tile < Map::Size()); @@ -802,7 +802,7 @@ static bool TryBuildLightHouse() static bool TryBuildTransmitter() { TileIndex tile = RandomTile(); - int h; + uint h; if (IsTileType(tile, MP_CLEAR) && IsTileFlat(tile, &h) && h >= 4 && !IsBridgeAbove(tile)) { TileIndex t = tile; if (CircularTileSearch(&t, 9, HasTransmitter, nullptr)) return false; diff --git a/src/tile_map.cpp b/src/tile_map.cpp index 54cfc8ebd2..63bdc4d851 100644 --- a/src/tile_map.cpp +++ b/src/tile_map.cpp @@ -92,7 +92,7 @@ std::tuple GetTilePixelSlopeOutsideMap(int x, int y) * @param h If not \c nullptr, pointer to storage of z height (only if tile is flat) * @return Whether the tile is flat */ -bool IsTileFlat(TileIndex tile, int *h) +bool IsTileFlat(TileIndex tile, uint *h) { uint x1 = TileX(tile); uint y1 = TileY(tile); diff --git a/src/tile_map.h b/src/tile_map.h index 6fbb3a53fa..fb39822d22 100644 --- a/src/tile_map.h +++ b/src/tile_map.h @@ -269,7 +269,7 @@ std::tuple GetTileSlopeZ(TileIndex tile); int GetTileZ(TileIndex tile); int GetTileMaxZ(TileIndex tile); -bool IsTileFlat(TileIndex tile, int *h = nullptr); +bool IsTileFlat(TileIndex tile, uint *h = nullptr); /** * Return the slope of a given tile inside the map.