mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Changed IsTileFlat function parameter type from int * to uint *
parent
bf02cb014b
commit
b2cec6362b
|
@ -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. */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
* @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);
|
||||
|
|
|
@ -269,7 +269,7 @@ std::tuple<Slope, int> 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.
|
||||
|
|
Loading…
Reference in New Issue