diff options
author | rubidium <rubidium@openttd.org> | 2009-09-08 12:27:27 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-09-08 12:27:27 +0000 |
commit | 472ed0dc76894928570e8a04d79c7d22b5fdca15 (patch) | |
tree | bbe73d07fa4cfe6db2ebfb949a68d44db87a554a /src/graph_gui.cpp | |
parent | 535f71fc13ced5ed1f68886fcd5aebb47d35f53c (diff) | |
download | openttd-472ed0dc76894928570e8a04d79c7d22b5fdca15.tar.xz |
(svn r17473) -Codechange: use the post destructor for destroying companies too instead of complicating the graph GUI invalidate code.
Diffstat (limited to 'src/graph_gui.cpp')
-rw-r--r-- | src/graph_gui.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 8ba32105d..a77a44460 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -1198,11 +1198,11 @@ struct PerformanceRatingDetailWindow : Window { { /* Disable the companies who are not active */ for (CompanyID i = COMPANY_FIRST; i < MAX_COMPANIES; i++) { - this->SetWidgetDisabledState(i + PRW_COMPANY_FIRST, !Company::IsValidID(i) || i == data); + this->SetWidgetDisabledState(i + PRW_COMPANY_FIRST, !Company::IsValidID(i)); } /* Check if the currently selected company is still active. */ - if (this->company == data || (this->company != INVALID_COMPANY && !Company::IsValidID(this->company))) { + if (this->company != INVALID_COMPANY && !Company::IsValidID(this->company)) { /* Raise the widget for the previous selection. */ this->RaiseWidget(this->company + PRW_COMPANY_FIRST); this->company = INVALID_COMPANY; @@ -1211,7 +1211,6 @@ struct PerformanceRatingDetailWindow : Window { if (this->company == INVALID_COMPANY) { const Company *c; FOR_ALL_COMPANIES(c) { - if (c->index == data) continue; // Ignore to-be-removed company this->company = c->index; break; } |