diff options
author | yexo <yexo@openttd.org> | 2010-01-29 15:45:53 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-01-29 15:45:53 +0000 |
commit | 81882039e3fd650ce3530c72ee2f14be784490d0 (patch) | |
tree | 3f0ef1fcc75afa816362a6fddf7c095997a43462 /src/ai | |
parent | a668e801e406718e6e9295db0a0c60be11878afe (diff) | |
download | openttd-81882039e3fd650ce3530c72ee2f14be784490d0.tar.xz |
(svn r18947) -Fix [FS#1510]: after clicking move up/move down in the newgrf/ai the selected item could be out of range
Diffstat (limited to 'src/ai')
-rw-r--r-- | src/ai/ai_gui.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 01506ada5..1705af314 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -604,6 +604,7 @@ struct AIConfigWindow : public Window { if (this->selected_slot > 1) { Swap(_settings_newgame.ai_config[this->selected_slot], _settings_newgame.ai_config[this->selected_slot - 1]); this->selected_slot--; + this->vscroll.ScrollTowards(this->selected_slot); this->InvalidateData(); } break; @@ -612,6 +613,7 @@ struct AIConfigWindow : public Window { if (this->selected_slot < _settings_newgame.difficulty.max_no_competitors) { Swap(_settings_newgame.ai_config[this->selected_slot], _settings_newgame.ai_config[this->selected_slot + 1]); this->selected_slot++; + this->vscroll.ScrollTowards(this->selected_slot); this->InvalidateData(); } break; |