changeset 4690:31f5a59d008f draft

(svn r6595) -Fix r6542: [depot window] clicking sell all in a depot with no vehicles will now do nothing at all (instead of opening the confination window) (spotted by glx)
author bjarni <bjarni@openttd.org>
date Sat, 30 Sep 2006 23:53:35 +0000
parents a10f7847ed30
children be71ad62047f
files depot_gui.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/depot_gui.c
+++ b/depot_gui.c
@@ -667,7 +667,10 @@
 					break;
 
 				case DEPOT_WIDGET_SELL_ALL:
-					ShowDepotSellAllWindow(w->window_number, WP(w, depot_d).type);
+					/* Only open the confimation window if there are anything to sell */
+					if (WP(w, depot_d).engine_count != 0 || WP(w, depot_d).wagon_count != 0) {
+						ShowDepotSellAllWindow(w->window_number, WP(w, depot_d).type);
+					}
 					break;
 
 				case DEPOT_WIDGET_VEHICLE_LIST: