diff options
author | smatz <smatz@openttd.org> | 2008-09-24 16:40:06 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-09-24 16:40:06 +0000 |
commit | 6987e6015af482de4bfa2a9233a6377d2fb1457a (patch) | |
tree | 4bdc7914fbb86480437af0957e290777e16788c6 /src/vehicle_gui.cpp | |
parent | 7a527807d908cfd667c8d32f89435f33f2d231a6 (diff) | |
download | openttd-6987e6015af482de4bfa2a9233a6377d2fb1457a.tar.xz |
(svn r14395) -Fix [FS#2285]: crashes and GUI desyncs when order is deleted/modified while the timetable window is open
-Fix: close any dropdown and child windows in the Order and Timetable windows when selected order is deselected, deleted, ...
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 55ddc2f21..5f9045a82 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -433,10 +433,11 @@ static const WindowDesc _vehicle_refit_desc = { * @param *v The vehicle to show the refit window for * @param order of the vehicle ( ? ) */ -void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order) +void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *parent) { DeleteWindowById(WC_VEHICLE_REFIT, v->index); - new RefitWindow(&_vehicle_refit_desc, v, order); + RefitWindow *w = new RefitWindow(&_vehicle_refit_desc, v, order); + w->parent = parent; } /** Display additional text from NewGRF in the purchase information window */ @@ -656,7 +657,7 @@ static inline void ChangeVehicleWindow(WindowClass window_class, VehicleID from_ if (w != NULL) { w->window_number = to_index; if (w->viewport != NULL) w->viewport->follow_vehicle = to_index; - if (to_index != INVALID_VEHICLE) InvalidateThisWindowData(w); + if (to_index != INVALID_VEHICLE) InvalidateThisWindowData(w, 0); } } @@ -1979,7 +1980,7 @@ struct VehicleViewWindow : Window { _vehicle_command_translation_table[VCT_CMD_GOTO_DEPOT][v->type]); break; case VVW_WIDGET_REFIT_VEH: // refit - ShowVehicleRefitWindow(v, INVALID_VEH_ORDER_ID); + ShowVehicleRefitWindow(v, INVALID_VEH_ORDER_ID, this); break; case VVW_WIDGET_SHOW_ORDERS: // show orders if (_ctrl_pressed) { |