|
@@ -2736,19 +2736,19 @@ static ChangeInfoResult GlobalVarChangeI
|
|
|
byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS];
|
|
|
|
|
|
for (uint i = 0; i < SNOW_LINE_MONTHS; i++) {
|
|
|
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 + _settings_game.construction.max_heightlevel) / 256;
|
|
|
if (table[i][j] != 0xFF) table[i][j] = table[i][j] * (1 + _settings_game.construction.map_height_limit) / 256;
|
|
|
} else {
|
|
|
if (table[i][j] >= 128) {
|
|
|
/* no snow */
|
|
|
table[i][j] = 0xFF;
|
|
|
} else {
|
|
|
table[i][j] = table[i][j] * (1 + _settings_game.construction.max_heightlevel) / 128;
|
|
|
table[i][j] = table[i][j] * (1 + _settings_game.construction.map_height_limit) / 128;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
SetSnowLine(table);
|
|
|
}
|
|
@@ -6333,13 +6333,13 @@ bool GetGlobalVariable(byte param, uint3
|
|
|
return true;
|
|
|
|
|
|
/* case 0x1F: // locale dependent settings not implemented to avoid desync */
|
|
|
|
|
|
case 0x20: { // snow line height
|
|
|
byte snowline = GetSnowLine();
|
|
|
if (_settings_game.game_creation.landscape == LT_ARCTIC && snowline <= _settings_game.construction.max_heightlevel) {
|
|
|
if (_settings_game.game_creation.landscape == LT_ARCTIC && snowline <= _settings_game.construction.map_height_limit) {
|
|
|
*value = Clamp(snowline * (grffile->grf_version >= 8 ? 1 : TILE_HEIGHT), 0, 0xFE);
|
|
|
} else {
|
|
|
/* No snow */
|
|
|
*value = 0xFF;
|
|
|
}
|
|
|
return true;
|
|
@@ -7008,13 +7008,13 @@ static uint32 GetPatchVariable(uint8 par
|
|
|
return (map_bits << 24) | (std::min(log_X, log_Y) << 20) | (max_edge << 16) |
|
|
|
(log_X << 12) | (log_Y << 8) | (log_X + log_Y);
|
|
|
}
|
|
|
|
|
|
/* The maximum height of the map. */
|
|
|
case 0x14:
|
|
|
return _settings_game.construction.max_heightlevel;
|
|
|
return _settings_game.construction.map_height_limit;
|
|
|
|
|
|
/* Extra foundations base sprite */
|
|
|
case 0x15:
|
|
|
return SPR_SLOPES_BASE;
|
|
|
|
|
|
/* Shore base sprite */
|