forked from mirror/OpenTTD
(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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user