summaryrefslogtreecommitdiff
path: root/src/tree_cmd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-11-23 16:45:53 +0000
committersmatz <smatz@openttd.org>2008-11-23 16:45:53 +0000
commitd0e4cc5ee057b8262adf99c3383114295776c3ca (patch)
treee479f1e64af9b12409e169e94724aff6d723fe04 /src/tree_cmd.cpp
parente35be92a3a1bb75a8bd4f063b4d3cb3a435a6794 (diff)
downloadopenttd-d0e4cc5ee057b8262adf99c3383114295776c3ca.tar.xz
(svn r14614) -Codechange [FS#2423]: GetTreeCount() should behave as its name and documentation imply. Remove unused SetTreeCount() (PhilSophus)
Diffstat (limited to 'src/tree_cmd.cpp')
-rw-r--r--src/tree_cmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index bedd9573a..cbd28e6da 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -350,7 +350,7 @@ CommandCost CmdPlantTree(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
switch (GetTileType(tile)) {
case MP_TREES:
/* no more space for trees? */
- if (_game_mode != GM_EDITOR && GetTreeCount(tile) == 3) {
+ if (_game_mode != GM_EDITOR && GetTreeCount(tile) == 4) {
msg = STR_2803_TREE_ALREADY_HERE;
continue;
}
@@ -478,7 +478,7 @@ static void DrawTile_Trees(TileInfo *ti)
TreeListEnt te[4];
/* put the trees to draw in a list */
- uint trees = GetTreeCount(ti->tile) + 1;
+ uint trees = GetTreeCount(ti->tile);
for (uint i = 0; i < trees; i++) {
SpriteID image = s[0].sprite + (i == trees - 1 ? GetTreeGrowth(ti->tile) : 3);
@@ -538,7 +538,7 @@ static CommandCost ClearTile_Trees(TileIndex tile, byte flags)
if (t != NULL) ChangeTownRating(t, RATING_TREE_DOWN_STEP, RATING_TREE_MINIMUM);
}
- num = GetTreeCount(tile) + 1;
+ num = GetTreeCount(tile);
if (IsInsideMM(GetTreeType(tile), TREE_RAINFOREST, TREE_CACTUS)) num *= 4;
if (flags & DC_EXEC) DoClearSquare(tile);
@@ -664,7 +664,7 @@ static void TileLoop_Trees(TileIndex tile)
break;
case 1: /* add a tree */
- if (GetTreeCount(tile) < 3) {
+ if (GetTreeCount(tile) < 4) {
AddTreeCount(tile, 1);
SetTreeGrowth(tile, 0);
break;
@@ -694,7 +694,7 @@ static void TileLoop_Trees(TileIndex tile)
break;
case 6: /* final stage of tree destruction */
- if (GetTreeCount(tile) > 0) {
+ if (GetTreeCount(tile) > 1) {
/* more than one tree, delete it */
AddTreeCount(tile, -1);
SetTreeGrowth(tile, 3);