summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-10-23 10:50:34 +0000
committerrubidium <rubidium@openttd.org>2014-10-23 10:50:34 +0000
commit1d27ae9bdaa056b37de19233354ee76b43f0aad4 (patch)
tree8f96da644bc886f2a5b1dd2b70b4d72c9229eae4
parent0c0f660059f76624b4bdf2beef784d2a28d6c3b8 (diff)
downloadopenttd-1d27ae9bdaa056b37de19233354ee76b43f0aad4.tar.xz
(svn r27036) -Fix [FS#6148] (r26928): crash when changing smallmap colour when the smallmap window has not been opened yet
-rw-r--r--src/smallmap_gui.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 18c0fc25a..dea0caa39 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -279,6 +279,9 @@ static SmallMapColourScheme _heightmap_schemes[] = {
*/
void BuildLandLegend()
{
+ /* The smallmap window has never been initialized, so no need to change the legend. */
+ if (_heightmap_schemes[0].height_colours == NULL) return;
+
/*
* The general idea of this function is to fill the legend with an appropriate evenly spaced
* selection of height levels. All entries with STR_TINY_BLACK_HEIGHT are reserved for this.