summaryrefslogtreecommitdiff
path: root/src/landscape.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-02-23 20:03:38 +0000
committerfrosch <frosch@openttd.org>2009-02-23 20:03:38 +0000
commita987c7299b735b35dfa58a182421b63ab12653db (patch)
treeb1820d210841db1ef7aed6eb98e8309b5131b96b /src/landscape.cpp
parentcabfe35e5406b2b50ec00385483df10abf590032 (diff)
downloadopenttd-a987c7299b735b35dfa58a182421b63ab12653db.tar.xz
(svn r15559) -Feature: Show required/already-delivered cargo needed for town-growth in town-view-window. (and only if it is really needed)
Diffstat (limited to 'src/landscape.cpp')
-rw-r--r--src/landscape.cpp12
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
*/