Import remove all trees in scenario editor patch.

http://www.tt-forums.net/viewtopic.php?f=33&t=49326

Update to current current version.
Use CMD_LANDSCAPE_CLEAR instead of CMD_CLEAR_AREA.
Whitespace, misc fixes.
This commit is contained in:
patch-import
2016-01-28 00:08:34 +00:00
committed by Jonathan G Rennison
parent 2c9029703b
commit 2e04f211df
4 changed files with 31 additions and 0 deletions

View File

@@ -356,6 +356,24 @@ void PlaceTreesRandomly()
}
}
/**
* Remove all trees
*
* This function remove all trees on the map.
*/
void RemoveAllTrees()
{
for(uint i = 0; i < MapSizeX(); i++) {
for(uint j = 0; j < MapSizeY(); j++) {
TileIndex tile = TileXY(i, j);
if(GetTileType(tile) == MP_TREES) {
DoCommandP(tile, 0, 0, CMD_LANDSCAPE_CLEAR | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound10);
}
}
}
}
/**
* Place new trees.
*