File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1313#include " heightmap.h"
1414#include " clear_map.h"
1515#include " spritecache.h"
16+ #include " station_map.h"
1617#include " viewport_func.h"
1718#include " command_func.h"
1819#include " landscape.h"
@@ -682,8 +683,11 @@ CommandCost CmdLandscapeClear(DoCommandFlags flags, TileIndex tile)
682683 /* Test for stuff which results in water when cleared. Then add the cost to also clear the water. */
683684 if (flags.Test (DoCommandFlag::ForceClearTile) && HasTileWaterClass (tile) && IsTileOnWater (tile) && !IsWaterTile (tile) && !IsCoastTile (tile)) {
684685 if (flags.Test (DoCommandFlag::Auto) && GetWaterClass (tile) == WaterClass::Canal) return CommandCost (STR_ERROR_MUST_DEMOLISH_CANAL_FIRST);
685- do_clear = true ;
686- cost.AddCost (GetWaterClass (tile) == WaterClass::Canal ? _price[PR_CLEAR_CANAL] : _price[PR_CLEAR_WATER]);
686+ /* Buoy tiles are special as they can be cleared by anyone, but the underlying tile shouldn't be cleared if it has a different owner. */
687+ if (!IsBuoyTile (tile) || GetTileOwner (tile) == _current_company) {
688+ do_clear = true ;
689+ cost.AddCost (GetWaterClass (tile) == WaterClass::Canal ? _price[PR_CLEAR_CANAL] : _price[PR_CLEAR_WATER]);
690+ }
687691 }
688692
689693 Company *c = flags.Any ({DoCommandFlag::Auto, DoCommandFlag::Bankrupt}) ? nullptr : Company::GetIfValid (_current_company);
You can’t perform that action at this time.
0 commit comments