Fix "remove all trees in scenario editor" being available in game.

This commit is contained in:
Jonathan G Rennison
2016-02-07 13:49:17 +00:00
parent cd298f4722
commit 224e927e0c
2 changed files with 3 additions and 1 deletions

View File

@@ -363,6 +363,8 @@ void PlaceTreesRandomly()
*/ */
void RemoveAllTrees() void RemoveAllTrees()
{ {
if (_game_mode != GM_EDITOR) return;
for(uint i = 0; i < MapSizeX(); i++) { for(uint i = 0; i < MapSizeX(); i++) {
for(uint j = 0; j < MapSizeY(); j++) { for(uint j = 0; j < MapSizeY(); j++) {
TileIndex tile = TileXY(i, j); TileIndex tile = TileXY(i, j);

View File

@@ -80,7 +80,7 @@ public:
return; return;
} }
if (widget != WID_BT_MANY_RANDOM) return; if (widget != WID_BT_MANY_RANDOM && widget != WID_BT_REMOVE_ALL) return;
if (_game_mode != GM_EDITOR) { if (_game_mode != GM_EDITOR) {
size->width = 0; size->width = 0;