summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2006-11-30 21:33:09 +0000
committerKUDr <kudr@openttd.org>2006-11-30 21:33:09 +0000
commit81ba2ad919eb8fb8ff8f1183db24aa2e60fe07cf (patch)
treeaf1405fdfc713ad0ccec154c7ac0c19b65944fa0
parent952cb2ee5c598fbefc1fd4a71307ed3b8caaef76 (diff)
downloadopenttd-81ba2ad919eb8fb8ff8f1183db24aa2e60fe07cf.tar.xz
(svn r7308) -Codechange: call GenerateBuildList() only when needed instead of on each redraw (peter1138)
-rw-r--r--build_vehicle_gui.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/build_vehicle_gui.c b/build_vehicle_gui.c
index 4d7f7542a..b1c82c95f 100644
--- a/build_vehicle_gui.c
+++ b/build_vehicle_gui.c
@@ -335,8 +335,6 @@ static void DrawBuildAircraftWindow(Window *w)
SetWindowWidgetDisabledState(w, BUILD_VEHICLE_WIDGET_BUILD, w->window_number == 0);
- GenerateBuildList(w);
-
if (bv->sel_engine != INVALID_ENGINE) {
int i;
bool found = false;
@@ -429,6 +427,7 @@ static void NewAircraftWndProc(Window *w, WindowEvent *e)
switch (e->event) {
case WE_INVALIDATE_DATA:
+ GenerateBuildList(w);
SetWindowDirty(w);
break;