diff options
author | rubidium <rubidium@openttd.org> | 2013-11-23 13:17:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-11-23 13:17:45 +0000 |
commit | 78a316d349f02c76b89c6fd7597e7013c062133a (patch) | |
tree | f9ed8c8d687f7081d6de04c70a82060d4ed2f040 /src/smallmap_gui.cpp | |
parent | 29ef70c246293ebde72f36e0a01483eeac6f7fdf (diff) | |
download | openttd-78a316d349f02c76b89c6fd7597e7013c062133a.tar.xz |
(svn r26061) -Fix: negative result of ftell wasn't handled correctly in some cases
Diffstat (limited to 'src/smallmap_gui.cpp')
-rw-r--r-- | src/smallmap_gui.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 8e53ade6f..85a123626 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1418,10 +1418,12 @@ int SmallMapWindow::GetPositionOnLegend(Point pt) case WID_SM_LEGEND: // Legend if (this->map_type == SMT_INDUSTRY || this->map_type == SMT_LINKSTATS || this->map_type == SMT_OWNER) { int click_pos = this->GetPositionOnLegend(pt); + if (click_pos < 0) break; + /* If industry type small map*/ if (this->map_type == SMT_INDUSTRY) { /* If click on industries label, find right industry type and enable/disable it. */ - if (click_pos >= 0 && click_pos < _smallmap_industry_count) { + if (click_pos < _smallmap_industry_count) { this->SelectLegendItem(click_pos, _legend_from_industries, _smallmap_industry_count); } } else if (this->map_type == SMT_LINKSTATS) { |