(svn r7206) -Codechange: Remove (some of) the magic needed for windows that could be invalid after

a call to DeleteWindow() somewhere else. Also do some cleanup with AllowWindowDescFront()
This commit is contained in:
Darkvater
2006-11-18 17:04:44 +00:00
parent b3c48c0a84
commit 53f954edd3
8 changed files with 6 additions and 29 deletions

View File

@@ -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)