summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-03-13 21:35:50 +0000
committerfrosch <frosch@openttd.org>2011-03-13 21:35:50 +0000
commitcba6eb87c2493e9d86d37db865bb85817d451c80 (patch)
tree48a638f5db7c8570fa43b1e64a9770bf95a37452 /src/ai
parent141f2eba50aa0e475a49610b05c00d0f549ae53f (diff)
downloadopenttd-cba6eb87c2493e9d86d37db865bb85817d451c80.tar.xz
(svn r22249) -Codechange: Process some more invalidation of IDs during command scope.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_gui.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index e7b704e5c..edbd9652c 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -711,11 +711,12 @@ struct AIConfigWindow : public Window {
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
{
- if (!gui_scope) return;
if (!IsEditable(this->selected_slot)) {
this->selected_slot = INVALID_COMPANY;
}
+ if (!gui_scope) return;
+
this->SetWidgetDisabledState(AIC_WIDGET_DECREASE, GetGameSettings().difficulty.max_no_competitors == 0);
this->SetWidgetDisabledState(AIC_WIDGET_INCREASE, GetGameSettings().difficulty.max_no_competitors == MAX_COMPANIES - 1);
this->SetWidgetDisabledState(AIC_WIDGET_CHANGE, this->selected_slot == INVALID_COMPANY);