summaryrefslogtreecommitdiff
path: root/src/tree_cmd.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-01-03 23:50:58 +0000
committerglx <glx@openttd.org>2008-01-03 23:50:58 +0000
commit42bddcf723fdcabf6ea8d4069effc086710ef156 (patch)
tree026efa2300b2925d9151a9d24da6c7fc6329a271 /src/tree_cmd.cpp
parentaebcd80088bfe4ecba84f37f55fbef1e4ffdb187 (diff)
downloadopenttd-42bddcf723fdcabf6ea8d4069effc086710ef156.tar.xz
(svn r11749) -Fix (r11352): when a bankrupted company is bought, reset vehicle color mapping so the vehicles use the new owner color
Diffstat (limited to 'src/tree_cmd.cpp')
-rw-r--r--src/tree_cmd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index 5d00f96fc..713100f71 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 ((flags & DC_EXEC) && IsValidPlayer(_current_player)) {
+ if (IsValidPlayer(_current_player)) {
Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority);
if (t != NULL)
ChangeTownRating(t, RATING_TREE_DOWN_STEP, RATING_TREE_MINIMUM);