(svn r6647) -Fix: [vehicle list windows] Lists of shared orders are now no longer closed by a window event if the list is empty

The window is now closed when the order is deleted.
   This is because removing windows from a window event is asking for problems
This commit is contained in:
bjarni
2006-10-05 08:27:40 +00:00
parent ff6f83b56c
commit 55c7840710
2 changed files with 18 additions and 5 deletions

View File

@@ -1553,10 +1553,9 @@ static void DrawVehicleListWindow(Window *w)
switch (window_type) {
case VLW_SHARED_ORDERS: /* Shared Orders */
if (vl->l.list_length == 0) {
/* The list is empty, so the last vehicle is sold or crashed */
/* Delete the window because the order is now not in use anymore */
DeleteWindow(w);
return;
/* We can't open this window without vehicles using this order
* and we should close the window when deleting the order */
NOT_REACHED();
}
SetDParam(0, w->vscroll.count);
break;