mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-22 22:19:08 +00:00
(svn r23096) -Codechange: remove useless divisions and multiplications by TILE_HEIGHT for the snow line code
This commit is contained in:
@@ -158,7 +158,7 @@ void TileLoopClearHelper(TileIndex tile)
|
||||
/** Convert to or from snowy tiles. */
|
||||
static void TileLoopClearAlps(TileIndex tile)
|
||||
{
|
||||
int k = GetTilePixelZ(tile) - GetSnowLine() + TILE_HEIGHT;
|
||||
int k = GetTileZ(tile) - GetSnowLine() + 1;
|
||||
|
||||
if (k < 0) {
|
||||
/* Below the snow line, do nothing if no snow. */
|
||||
@@ -173,7 +173,7 @@ static void TileLoopClearAlps(TileIndex tile)
|
||||
}
|
||||
/* Update snow density. */
|
||||
uint curent_density = GetClearDensity(tile);
|
||||
uint req_density = (k < 0) ? 0u : min((uint)k / TILE_HEIGHT, 3);
|
||||
uint req_density = (k < 0) ? 0u : min((uint)k, 3);
|
||||
|
||||
if (curent_density < req_density) {
|
||||
AddClearDensity(tile, 1);
|
||||
|
Reference in New Issue
Block a user