diff options
author | bjarni <bjarni@openttd.org> | 2006-10-07 14:30:13 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2006-10-07 14:30:13 +0000 |
commit | 208e258f4ce57ade70145db297a9b62fba6964b3 (patch) | |
tree | ff7fa2247d12cb30d71d1ac2a8941d2af01165f8 /engine.c | |
parent | db665677992de73be63e68ffed09c60907423f98 (diff) | |
download | openttd-208e258f4ce57ade70145db297a9b62fba6964b3.tar.xz |
(svn r6680) -Codechange r6679: [train build window] only generate the list when the window data is invalidated or the window is generated, not on each redraw
Diffstat (limited to 'engine.c')
-rw-r--r-- | engine.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -209,8 +209,11 @@ static void AcceptEnginePreview(Engine *e, PlayerID player) SETBIT(p->avail_railtypes, e->railtype); e->preview_player = 0xFF; - InvalidateWindowClasses(WC_BUILD_VEHICLE); - InvalidateWindowClasses(WC_REPLACE_VEHICLE); + if (player == _local_player) { + InvalidateWindowClassesData(WC_BUILD_VEHICLE); + InvalidateWindowClasses(WC_BUILD_VEHICLE); + InvalidateWindowClasses(WC_REPLACE_VEHICLE); + } } static PlayerID GetBestPlayer(PlayerID pp) @@ -332,6 +335,7 @@ static void NewVehicleAvailable(Engine *e) } e->flags = (e->flags & ~ENGINE_INTRODUCING) | ENGINE_AVAILABLE; + InvalidateWindowClassesData(WC_BUILD_VEHICLE); InvalidateWindowClasses(WC_BUILD_VEHICLE); InvalidateWindowClasses(WC_REPLACE_VEHICLE); |