Codechange: Use std::tuple for slope functions with two return values
This commit is contained in:
@@ -199,8 +199,7 @@
|
||||
{
|
||||
if (!::IsValidTile(tile) || !::IsValidCorner((::Corner)corner)) return -1;
|
||||
|
||||
int z;
|
||||
::Slope slope = ::GetTileSlope(tile, &z);
|
||||
auto [slope, z] = ::GetTileSlopeZ(tile);
|
||||
return (z + ::GetSlopeZInCorner(slope, (::Corner)corner));
|
||||
}
|
||||
|
||||
|
@@ -31,8 +31,7 @@
|
||||
/* If it's a tunnel already, take the easy way out! */
|
||||
if (IsTunnelTile(tile)) return ::GetOtherTunnelEnd(tile);
|
||||
|
||||
int start_z;
|
||||
Slope start_tileh = ::GetTileSlope(tile, &start_z);
|
||||
auto [start_tileh, start_z] = ::GetTileSlopeZ(tile);
|
||||
DiagDirection direction = ::GetInclinedSlopeDirection(start_tileh);
|
||||
if (direction == INVALID_DIAGDIR) return INVALID_TILE;
|
||||
|
||||
@@ -42,7 +41,7 @@
|
||||
tile += delta;
|
||||
if (!::IsValidTile(tile)) return INVALID_TILE;
|
||||
|
||||
::GetTileSlope(tile, &end_z);
|
||||
std::tie(std::ignore, end_z) = ::GetTileSlopeZ(tile);
|
||||
} while (start_z != end_z);
|
||||
|
||||
return tile;
|
||||
|
Reference in New Issue
Block a user