From 72afdb8d3440dc3570dd6d4c4b3127f1e7345642 Mon Sep 17 00:00:00 2001 From: glx Date: Thu, 3 Jan 2008 23:54:23 +0000 Subject: (svn r11750) -Revert (r11749): commited too much --- src/tree_cmd.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/tree_cmd.cpp') diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index 713100f71..5d00f96fc 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -330,16 +330,16 @@ CommandCost CmdPlantTree(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) default: break; } - if (_game_mode != GM_EDITOR && IsValidPlayer(_current_player)) { - Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority); - if (t != NULL) - ChangeTownRating(t, RATING_TREE_UP_STEP, RATING_TREE_MAXIMUM); - } - if (flags & DC_EXEC) { TreeType treetype; uint growth; + if (_game_mode != GM_EDITOR && IsValidPlayer(_current_player)) { + Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority); + if (t != NULL) + ChangeTownRating(t, RATING_TREE_UP_STEP, RATING_TREE_MAXIMUM); + } + treetype = (TreeType)p1; if (treetype == TREE_INVALID) { treetype = GetRandomTreeType(tile, GB(Random(), 24, 8)); @@ -488,7 +488,7 @@ static CommandCost ClearTile_Trees(TileIndex tile, byte flags) { uint num; - if (IsValidPlayer(_current_player)) { + if ((flags & DC_EXEC) && IsValidPlayer(_current_player)) { Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority); if (t != NULL) ChangeTownRating(t, RATING_TREE_DOWN_STEP, RATING_TREE_MINIMUM); -- cgit v1.2.3-54-g00ecf