summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-07-04 14:13:23 +0000
committeralberth <alberth@openttd.org>2009-07-04 14:13:23 +0000
commit2385aeae3c3b065fac37724334469f1ed9ea29f3 (patch)
treecf0b1ed226eb65a673c7bfea3cdbbc94f923fc20
parentc7c422465a4a272e1203d4b69a9836c8b5a2360a (diff)
downloadopenttd-2385aeae3c3b065fac37724334469f1ed9ea29f3.tar.xz
(svn r16739) -Codechange: Initialize internal data before computing the widgets.
-rw-r--r--src/town_gui.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 97f6b7dcc..bbc03ea61 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -588,15 +588,14 @@ private:
public:
TownDirectoryWindow(const WindowDesc *desc) : Window()
{
- this->townline_height = FONT_HEIGHT_NORMAL;
- this->InitNested(desc, 0);
-
- this->vscroll.cap = this->nested_array[TDW_CENTERTOWN]->current_y / this->resize.step_height;
-
this->towns.SetListing(this->last_sorting);
this->towns.SetSortFuncs(this->sorter_funcs);
this->towns.ForceRebuild();
this->BuildSortTownList();
+
+ this->townline_height = FONT_HEIGHT_NORMAL;
+ this->InitNested(desc, 0);
+ this->vscroll.cap = this->nested_array[TDW_CENTERTOWN]->current_y / this->resize.step_height;
}
~TownDirectoryWindow()