mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
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:
parent
6acbc775e5
commit
28a1267e57
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user