diff options
author | frosch <frosch@openttd.org> | 2010-04-23 21:47:03 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-04-23 21:47:03 +0000 |
commit | ca9a015984fa7c0c49ddb587635cd65b594c723a (patch) | |
tree | 66ef604573811953ed924662d2d2ce13653b8c4c /src/industry_gui.cpp | |
parent | 7a56196d98656a2080f5918699d37773ba294d69 (diff) | |
download | openttd-ca9a015984fa7c0c49ddb587635cd65b594c723a.tar.xz |
(svn r19701) -Fix [FS#3787]: Check for industry availability more thoroughly and cancel object placement when selecting not available industries.
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r-- | src/industry_gui.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 9b8433059..d9fc30eb7 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -463,8 +463,10 @@ public: this->SetDirty(); - if ((_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && indsp != NULL && indsp->IsRawIndustry()) || - this->selected_type == INVALID_INDUSTRYTYPE) { + if (GetCallbackWnd() == this && + ((_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && indsp != NULL && indsp->IsRawIndustry()) || + this->selected_type == INVALID_INDUSTRYTYPE || + !this->enabled[this->selected_index])) { /* Reset the button state if going to prospecting or "build many industries" */ this->RaiseButtons(); ResetObjectToPlace(); |