(svn r19701) -Fix [FS#3787]: Check for industry availability more thoroughly and cancel object placement when selecting not available industries.

This commit is contained in:
frosch
2010-04-23 21:47:03 +00:00
parent 7a56196d98
commit ca9a015984
3 changed files with 13 additions and 2 deletions

View File

@@ -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();