1
0
Fork 0

Codechange: Changed IsTileFlat function parameter type from int * to uint *

pull/13282/head
SamuXarick 2025-01-05 14:59:42 +00:00
parent bf02cb014b
commit b2cec6362b
4 changed files with 5 additions and 5 deletions

View File

@ -992,7 +992,7 @@ static void CreateDesertOrRainForest(uint desert_tropic_line)
*/ */
static bool FindSpring(TileIndex tile, void *) static bool FindSpring(TileIndex tile, void *)
{ {
int reference_height; uint reference_height;
if (!IsTileFlat(tile, &reference_height) || IsWaterTile(tile)) return false; if (!IsTileFlat(tile, &reference_height) || IsWaterTile(tile)) return false;
/* In the tropics rivers start in the rainforest. */ /* In the tropics rivers start in the rainforest. */

View File

@ -783,7 +783,7 @@ static bool TryBuildLightHouse()
if (!IsTileType(tile, MP_WATER)) return false; if (!IsTileType(tile, MP_WATER)) return false;
for (int j = 0; j < 19; j++) { for (int j = 0; j < 19; j++) {
int h; uint h;
if (IsTileType(tile, MP_CLEAR) && IsTileFlat(tile, &h) && h <= 2 && !IsBridgeAbove(tile)) { if (IsTileType(tile, MP_CLEAR) && IsTileFlat(tile, &h) && h <= 2 && !IsBridgeAbove(tile)) {
BuildObject(OBJECT_LIGHTHOUSE, tile); BuildObject(OBJECT_LIGHTHOUSE, tile);
assert(tile < Map::Size()); assert(tile < Map::Size());
@ -802,7 +802,7 @@ static bool TryBuildLightHouse()
static bool TryBuildTransmitter() static bool TryBuildTransmitter()
{ {
TileIndex tile = RandomTile(); TileIndex tile = RandomTile();
int h; uint h;
if (IsTileType(tile, MP_CLEAR) && IsTileFlat(tile, &h) && h >= 4 && !IsBridgeAbove(tile)) { if (IsTileType(tile, MP_CLEAR) && IsTileFlat(tile, &h) && h >= 4 && !IsBridgeAbove(tile)) {
TileIndex t = tile; TileIndex t = tile;
if (CircularTileSearch(&t, 9, HasTransmitter, nullptr)) return false; if (CircularTileSearch(&t, 9, HasTransmitter, nullptr)) return false;

View File

@ -92,7 +92,7 @@ std::tuple<Slope, int> GetTilePixelSlopeOutsideMap(int x, int y)
* @param h If not \c nullptr, pointer to storage of z height (only if tile is flat) * @param h If not \c nullptr, pointer to storage of z height (only if tile is flat)
* @return Whether the 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 x1 = TileX(tile);
uint y1 = TileY(tile); uint y1 = TileY(tile);

View File

@ -269,7 +269,7 @@ std::tuple<Slope, int> GetTileSlopeZ(TileIndex tile);
int GetTileZ(TileIndex tile); int GetTileZ(TileIndex tile);
int GetTileMaxZ(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. * Return the slope of a given tile inside the map.