diff options
author | glx <glx@openttd.org> | 2008-01-03 23:54:23 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-01-03 23:54:23 +0000 |
commit | 72afdb8d3440dc3570dd6d4c4b3127f1e7345642 (patch) | |
tree | bbec8af9e203adb15cc08783b1ea8a8a70114806 /src/tree_cmd.cpp | |
parent | 42bddcf723fdcabf6ea8d4069effc086710ef156 (diff) | |
download | openttd-72afdb8d3440dc3570dd6d4c4b3127f1e7345642.tar.xz |
(svn r11750) -Revert (r11749): commited too much
Diffstat (limited to 'src/tree_cmd.cpp')
-rw-r--r-- | src/tree_cmd.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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); |