summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-08 17:28:42 +0000
committerfrosch <frosch@openttd.org>2011-11-08 17:28:42 +0000
commit0f28b20a7364558d730f84c32b445f3dad95795c (patch)
tree81086e42868378dccfd2c31ad2e6b7fe207c3dca
parent7d4568361c92bcf448859f47103a59c0735a4f99 (diff)
downloadopenttd-0f28b20a7364558d730f84c32b445f3dad95795c.tar.xz
(svn r23152) -Change: [NewGRF v8] Snow line height table uses values between 0x00 and 0xFF independent of number of height levels.
-rw-r--r--src/newgrf.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 890b10034..e5fc2a1c1 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -2429,7 +2429,16 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
for (uint i = 0; i < SNOW_LINE_MONTHS; i++) {
for (uint j = 0; j < SNOW_LINE_DAYS; j++) {
table[i][j] = buf->ReadByte();
- if (table[i][j] != 0xFF) table[i][j] /= TILE_HEIGHT;
+ if (_cur.grffile->grf_version >= 8) {
+ if (table[i][j] != 0xFF) table[i][j] = table[i][j] * (1 + MAX_TILE_HEIGHT) / 256;
+ } else {
+ if (table[i][j] >= 128) {
+ /* no snow */
+ table[i][j] = 0xFF;
+ } else {
+ table[i][j] = table[i][j] * (1 + MAX_TILE_HEIGHT) / 128;
+ }
+ }
}
}
SetSnowLine(table);