Change: Adjust costs for clearing snowy landscape tiles.

Rocks with snow is no longer cheaper to clear than rocks without snow.
This commit is contained in:
Peter Nelson 2025-02-20 19:21:40 +00:00 committed by Peter Nelson
parent 6acbc775e5
commit 28a1267e57

View File

@ -35,10 +35,14 @@ static CommandCost ClearTile_Clear(TileIndex tile, DoCommandFlags flags)
}; };
CommandCost price(EXPENSES_CONSTRUCTION); CommandCost price(EXPENSES_CONSTRUCTION);
ClearGround ground = GetClearGround(tile);
uint8_t density = GetClearDensity(tile);
if (IsSnowTile(tile)) { if (IsSnowTile(tile)) {
price.AddCost(_price[clear_price_table[CLEAR_SNOW]]); price.AddCost(_price[clear_price_table[ground]]);
} else if (!IsClearGround(tile, CLEAR_GRASS) || GetClearDensity(tile) != 0) { /* Add a little more for removing snow. */
price.AddCost(_price[clear_price_table[GetClearGround(tile)]]); price.AddCost(std::abs(_price[PR_CLEAR_ROUGH] - _price[PR_CLEAR_GRASS]));
} else if (ground != CLEAR_GRASS || density != 0) {
price.AddCost(_price[clear_price_table[ground]]);
} }
if (flags.Test(DoCommandFlag::Execute)) DoClearSquare(tile); if (flags.Test(DoCommandFlag::Execute)) DoClearSquare(tile);