summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-10-11 11:06:04 +0000
committertruelight <truelight@openttd.org>2007-10-11 11:06:04 +0000
commit645e5b1fb08d4f75a7940857872bc4fdc8876ef7 (patch)
tree2f02157b68131ccb2d373fae8a24ef9d92b428de /src/openttd.cpp
parent1ff0197ca406eb1eb197a18a5a8e525f9c0f28bc (diff)
downloadopenttd-645e5b1fb08d4f75a7940857872bc4fdc8876ef7.tar.xz
(svn r11244) -Fix: trees can now be planted on bare land without making it grassy (Csaboka)
-Fix: planting tree in desert doesn't make it grassy for the first tile-cycle (Csaboka) -Fix: when a tree dies in desert, it no longer becomes a snowy tile for the first tile-cycle (Csaboka)
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index aa55e788c..1b6407720 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -76,6 +76,7 @@
#include "water_map.h"
#include "industry_map.h"
#include "unmovable_map.h"
+#include "tree_map.h"
#include <stdarg.h>
@@ -2196,6 +2197,19 @@ bool AfterLoadGame()
}
}
+ /* Before version 81, the density of grass was always stored as zero, and
+ * grassy trees were always drawn fully grassy. Furthermore, trees on rough
+ * land used to have zero density, now they have full density. Therefore,
+ * make all grassy/rough land trees have a density of 3. */
+ if (CheckSavegameVersion(81)) {
+ for (TileIndex t = 0; t < map_size; t++) {
+ if (GetTileType(t) == MP_TREES) {
+ TreeGround groundType = GetTreeGround(t);
+ if (groundType != TREE_GROUND_SNOW_DESERT) SetTreeGroundDensity(t, groundType, 3);
+ }
+ }
+ }
+
return true;
}