From a987c7299b735b35dfa58a182421b63ab12653db Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 23 Feb 2009 20:03:38 +0000 Subject: (svn r15559) -Feature: Show required/already-delivered cargo needed for town-growth in town-view-window. (and only if it is really needed) --- src/landscape.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/landscape.cpp') 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(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]); } } } @@ -572,6 +574,16 @@ byte HighestSnowLine(void) return _snow_line == NULL ? _settings_game.game_creation.snow_line : _snow_line->highest_value; } +/** + * 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 -- cgit v1.2.3-54-g00ecf