summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-09-21 12:02:03 +0000
committerrubidium <rubidium@openttd.org>2014-09-21 12:02:03 +0000
commitddfc8372eeca8d5a3db3cd6a8e49c63f893b0330 (patch)
tree9830a54adfa9e50f6dfdcba959fbf36fa614f9fc /src/newgrf.cpp
parentcfe08b86c9275fbfe42e5b49572720b01fb2de1d (diff)
downloadopenttd-ddfc8372eeca8d5a3db3cd6a8e49c63f893b0330.tar.xz
(svn r26884) -Change: scale the NewGRF's snow line level according to the configured maximum map height
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 88b3b25a4..14e7dd57a 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -2696,13 +2696,13 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
for (uint j = 0; j < SNOW_LINE_DAYS; j++) {
table[i][j] = buf->ReadByte();
if (_cur.grffile->grf_version >= 8) {
- if (table[i][j] != 0xFF) table[i][j] = table[i][j] * (1 + MAX_TILE_HEIGHT) / 256;
+ if (table[i][j] != 0xFF) table[i][j] = table[i][j] * (1 + _settings_game.construction.max_heightlevel) / 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;
+ table[i][j] = table[i][j] * (1 + _settings_game.construction.max_heightlevel) / 128;
}
}
}
@@ -5827,7 +5827,7 @@ bool GetGlobalVariable(byte param, uint32 *value, const GRFFile *grffile)
case 0x20: { // snow line height
byte snowline = GetSnowLine();
- if (_settings_game.game_creation.landscape == LT_ARCTIC && snowline <= MAX_TILE_HEIGHT) {
+ if (_settings_game.game_creation.landscape == LT_ARCTIC && snowline <= _settings_game.construction.max_heightlevel) {
*value = Clamp(snowline * (grffile->grf_version >= 8 ? 1 : TILE_HEIGHT), 0, 0xFE);
} else {
/* No snow */
@@ -6484,7 +6484,7 @@ static uint32 GetPatchVariable(uint8 param)
/* The maximum height of the map. */
case 0x14:
- return MAX_TILE_HEIGHT;
+ return _settings_game.construction.max_heightlevel;
/* Extra foundations base sprite */
case 0x15: