summaryrefslogtreecommitdiff
path: root/engine_gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'engine_gui.c')
-rw-r--r--engine_gui.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/engine_gui.c b/engine_gui.c
index 30a5e2cce..30c294b1e 100644
--- a/engine_gui.c
+++ b/engine_gui.c
@@ -93,12 +93,10 @@ static void EnginePreviewWndProc(Window *w, WindowEvent *e)
case WE_CLICK:
switch (e->we.click.widget) {
- case 3:
- DeleteWindow(w);
- break;
-
case 4:
DoCommandP(0, w->window_number, 0, NULL, CMD_WANT_ENGINE_PREVIEW);
+ /* Fallthrough */
+ case 3:
DeleteWindow(w);
break;
}
@@ -117,10 +115,7 @@ static const WindowDesc _engine_preview_desc = {
void ShowEnginePreviewWindow(EngineID engine)
{
- Window *w;
-
- w = AllocateWindowDesc(&_engine_preview_desc);
- w->window_number = engine;
+ Window *w = AllocateWindowDescFront(&_engine_preview_desc, engine);
}
static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw)