summaryrefslogtreecommitdiff
path: root/engine.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-10-07 14:30:13 +0000
committerbjarni <bjarni@openttd.org>2006-10-07 14:30:13 +0000
commit208e258f4ce57ade70145db297a9b62fba6964b3 (patch)
treeff7fa2247d12cb30d71d1ac2a8941d2af01165f8 /engine.c
parentdb665677992de73be63e68ffed09c60907423f98 (diff)
downloadopenttd-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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/engine.c b/engine.c
index cb546c44e..ddaa6391d 100644
--- a/engine.c
+++ b/engine.c
@@ -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);