summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
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;
}