From 28a1267e579ca32fca53a3f97e609e7d2b3f7501 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 20 Feb 2025 19:21:40 +0000 Subject: [PATCH] Change: Adjust costs for clearing snowy landscape tiles. Rocks with snow is no longer cheaper to clear than rocks without snow. --- src/clear_cmd.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp index 97b154d5bd..95bd0fc218 100644 --- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -35,10 +35,14 @@ static CommandCost ClearTile_Clear(TileIndex tile, DoCommandFlags flags) }; CommandCost price(EXPENSES_CONSTRUCTION); + ClearGround ground = GetClearGround(tile); + uint8_t density = GetClearDensity(tile); if (IsSnowTile(tile)) { - price.AddCost(_price[clear_price_table[CLEAR_SNOW]]); - } else if (!IsClearGround(tile, CLEAR_GRASS) || GetClearDensity(tile) != 0) { - price.AddCost(_price[clear_price_table[GetClearGround(tile)]]); + price.AddCost(_price[clear_price_table[ground]]); + /* Add a little more for removing snow. */ + 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);