From 141f2eba50aa0e475a49610b05c00d0f549ae53f Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 13 Mar 2011 21:34:49 +0000 Subject: (svn r22248) -Codechange: Make OnInvalidateData() process 'delete this;' already in command scope. --- src/ai/ai_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ai') diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 339201a94..e7b704e5c 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -189,12 +189,13 @@ struct AIListWindow : public Window { */ virtual void OnInvalidateData(int data = 0, bool gui_scope = true) { - if (!gui_scope) return; if (_game_mode == GM_NORMAL && Company::IsValidID(this->slot)) { delete this; return; } + if (!gui_scope) return; + this->vscroll->SetCount((int)this->ai_info_list->size() + 1); /* selected goes from -1 .. length of ai list - 1. */ @@ -450,7 +451,6 @@ struct AISettingsWindow : public Window { */ virtual void OnInvalidateData(int data = 0, bool gui_scope = true) { - if (!gui_scope) return; if (_game_mode == GM_NORMAL && Company::IsValidID(this->slot)) delete this; } }; -- cgit v1.2.3-70-g09d2