(svn r27036) -Fix [FS#6148] (r26928): crash when changing smallmap colour when the smallmap window has not been opened yet

This commit is contained in:
rubidium 2014-10-23 10:50:34 +00:00
parent 0c0f660059
commit 1d27ae9bda
1 changed files with 3 additions and 0 deletions

View File

@ -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.