diff --git a/src/script/api/script_tile.cpp b/src/script/api/script_tile.cpp index e4286dd9f1..d5f7cc6c84 100644 --- a/src/script/api/script_tile.cpp +++ b/src/script/api/script_tile.cpp @@ -252,7 +252,7 @@ /* static */ bool ScriptTile::RaiseTile(TileIndex tile, Slope slope) { - EnforceCompanyModeValid(false); + EnforceDeityOrCompanyModeValid(false); EnforcePrecondition(false, tile < ScriptMap::GetMapSize()); return ScriptObject::Command::Do(tile, (::Slope)slope, true); @@ -260,7 +260,7 @@ /* static */ bool ScriptTile::LowerTile(TileIndex tile, Slope slope) { - EnforceCompanyModeValid(false); + EnforceDeityOrCompanyModeValid(false); EnforcePrecondition(false, tile < ScriptMap::GetMapSize()); return ScriptObject::Command::Do(tile, (::Slope)slope, false); @@ -268,7 +268,7 @@ /* static */ bool ScriptTile::LevelTiles(TileIndex start_tile, TileIndex end_tile) { - EnforceCompanyModeValid(false); + EnforceDeityOrCompanyModeValid(false); EnforcePrecondition(false, start_tile < ScriptMap::GetMapSize()); EnforcePrecondition(false, end_tile < ScriptMap::GetMapSize()); @@ -285,7 +285,7 @@ /* static */ bool ScriptTile::PlantTree(TileIndex tile) { - EnforceCompanyModeValid(false); + EnforceDeityOrCompanyModeValid(false); EnforcePrecondition(false, ::IsValidTile(tile)); return ScriptObject::Command::Do(tile, tile, TREE_INVALID, false); @@ -293,7 +293,7 @@ /* static */ bool ScriptTile::PlantTreeRectangle(TileIndex tile, SQInteger width, SQInteger height) { - EnforceCompanyModeValid(false); + EnforceDeityOrCompanyModeValid(false); EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, width >= 1 && width <= 20); EnforcePrecondition(false, height >= 1 && height <= 20); diff --git a/src/script/api/script_tile.hpp b/src/script/api/script_tile.hpp index de476ffb69..d12a10c606 100644 --- a/src/script/api/script_tile.hpp +++ b/src/script/api/script_tile.hpp @@ -418,7 +418,6 @@ public: * @param tile The tile to raise. * @param slope Corners to raise (SLOPE_xxx). * @pre tile < ScriptMap::GetMapSize(). - * @game @pre ScriptCompanyMode::IsValid(). * @exception ScriptError::ERR_AREA_NOT_CLEAR * @exception ScriptError::ERR_TOO_CLOSE_TO_EDGE * @exception ScriptTile::ERR_TILE_TOO_HIGH @@ -435,7 +434,6 @@ public: * @param tile The tile to lower. * @param slope Corners to lower (SLOPE_xxx). * @pre tile < ScriptMap::GetMapSize(). - * @game @pre ScriptCompanyMode::IsValid(). * @exception ScriptError::ERR_AREA_NOT_CLEAR * @exception ScriptError::ERR_TOO_CLOSE_TO_EDGE * @exception ScriptTile::ERR_TILE_TOO_LOW @@ -451,7 +449,6 @@ public: * @param end_tile The opposite corner of the rectangle. * @pre start_tile < ScriptMap::GetMapSize(). * @pre end_tile < ScriptMap::GetMapSize(). - * @game @pre ScriptCompanyMode::IsValid(). * @exception ScriptError::ERR_AREA_NOT_CLEAR * @exception ScriptError::ERR_TOO_CLOSE_TO_EDGE * @return True if one or more tiles were leveled. @@ -475,7 +472,6 @@ public: * Create a random tree on a tile. * @param tile The tile to build a tree on. * @pre ScriptMap::IsValidTile(tile). - * @game @pre ScriptCompanyMode::IsValid(). * @return True if and only if a tree was added on the tile. */ static bool PlantTree(TileIndex tile); @@ -488,7 +484,6 @@ public: * @pre ScriptMap::IsValidTile(tile). * @pre width >= 1 && width <= 20. * @pre height >= 1 && height <= 20. - * @game @pre ScriptCompanyMode::IsValid(). * @return True if and only if a tree was added on any of the tiles in the rectangle. */ static bool PlantTreeRectangle(TileIndex tile, SQInteger width, SQInteger height); diff --git a/src/terraform_cmd.h b/src/terraform_cmd.h index 892b59b440..0d864b62f4 100644 --- a/src/terraform_cmd.h +++ b/src/terraform_cmd.h @@ -17,8 +17,8 @@ std::tuple CmdTerraformLand(DoCommandFlag flags, TileIndex tile, Slope slope, bool dir_up); std::tuple CmdLevelLand(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, bool diagonal, LevelMode lm); -DEF_CMD_TRAIT(CMD_TERRAFORM_LAND, CmdTerraformLand, CMD_ALL_TILES | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) -DEF_CMD_TRAIT(CMD_LEVEL_LAND, CmdLevelLand, CMD_ALL_TILES | CMD_AUTO | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // test run might clear tiles multiple times, in execution that only happens once +DEF_CMD_TRAIT(CMD_TERRAFORM_LAND, CmdTerraformLand, CMD_DEITY | CMD_ALL_TILES | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_LEVEL_LAND, CmdLevelLand, CMD_DEITY | CMD_ALL_TILES | CMD_AUTO | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // test run might clear tiles multiple times, in execution that only happens once CommandCallback CcPlaySound_EXPLOSION; void CcTerraform(Commands cmd, const CommandCost &result, Money, TileIndex tile); diff --git a/src/tree_cmd.h b/src/tree_cmd.h index fd85dec319..268f996b27 100644 --- a/src/tree_cmd.h +++ b/src/tree_cmd.h @@ -14,6 +14,6 @@ CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, uint8_t tree_to_plant, bool diagonal); -DEF_CMD_TRAIT(CMD_PLANT_TREE, CmdPlantTree, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_PLANT_TREE, CmdPlantTree, CMD_DEITY | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) #endif /* TREE_CMD_H */