From 0f28b20a7364558d730f84c32b445f3dad95795c Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 8 Nov 2011 17:28:42 +0000 Subject: (svn r23152) -Change: [NewGRF v8] Snow line height table uses values between 0x00 and 0xFF independent of number of height levels. --- src/newgrf.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/newgrf.cpp') 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); -- cgit v1.2.3-54-g00ecf