From f4482907dabf064299c7ef50a3ff47589ccb54ff Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 30 Aug 2007 17:17:04 +0000 Subject: (svn r11005) -Codechange: move the tiletype specific terraforming checks to the functions for those tile types. -Codechange: barren the rail grounds on terraforming. --- src/unmovable_cmd.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/unmovable_cmd.cpp') diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp index 079e46d07..ee486cbfa 100644 --- a/src/unmovable_cmd.cpp +++ b/src/unmovable_cmd.cpp @@ -398,6 +398,14 @@ static void ChangeTileOwner_Unmovable(TileIndex tile, PlayerID old_player, Playe } } +static CommandCost TerraformTile_Unmovable(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new) +{ + /* Owned land remains unsold */ + if (IsOwnedLand(tile) && CheckTileOwnership(tile)) return CommandCost(); + + return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); +} + extern const TileTypeProcs _tile_type_unmovable_procs = { DrawTile_Unmovable, /* draw_tile_proc */ GetSlopeZ_Unmovable, /* get_slope_z_proc */ @@ -412,4 +420,5 @@ extern const TileTypeProcs _tile_type_unmovable_procs = { NULL, /* get_produced_cargo_proc */ NULL, /* vehicle_enter_tile_proc */ GetFoundation_Unmovable, /* get_foundation_proc */ + TerraformTile_Unmovable, /* terraform_tile_proc */ }; -- cgit v1.2.3-54-g00ecf