diff options
Diffstat (limited to 'src/landscape.cpp')
-rw-r--r-- | src/landscape.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp index 92e2ba7d3..1ddd2bcfe 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -539,11 +539,13 @@ bool IsSnowLineSet(void) void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]) { _snow_line = CallocT<SnowLine>(1); + _snow_line->lowest_value = 0xFF; memcpy(_snow_line->table, table, sizeof(_snow_line->table)); for (uint i = 0; i < SNOW_LINE_MONTHS; i++) { for (uint j = 0; j < SNOW_LINE_DAYS; j++) { _snow_line->highest_value = max(_snow_line->highest_value, table[i][j]); + _snow_line->lowest_value = min(_snow_line->lowest_value, table[i][j]); } } } @@ -573,6 +575,16 @@ byte HighestSnowLine(void) } /** + * Get the lowest possible snow line height, either variable or static. + * @return the lowest snow line height. + * @ingroup SnowLineGroup + */ +byte LowestSnowLine(void) +{ + return _snow_line == NULL ? _settings_game.game_creation.snow_line : _snow_line->lowest_value; +} + +/** * Clear the variable snow line table and free the memory. * @ingroup SnowLineGroup */ |