changeset 19901:9edbe277d872 draft

(svn r24834) -Fix [FS#5396]: The autorefit dropdown in the order GUI wasn't always updated when modifying vehicle consists.
author michi_cc <michi_cc@openttd.org>
date Thu, 20 Dec 2012 19:44:06 +0000
parents b4c4f1c24136
children 4daa067130e8
files src/order_gui.cpp src/train_cmd.cpp
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -869,6 +869,10 @@
 			case VIWD_AUTOREPLACE:
 				/* Autoreplace replaced the vehicle */
 				this->vehicle = Vehicle::Get(this->window_number);
+				/* FALL THROUGH */
+
+			case VIWD_CONSIST_CHANGED:
+				/* Vehicle composition was changed. */
 				this->UpdateAutoRefitState();
 				break;
 
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -242,6 +242,7 @@
 		this->UpdateAcceleration();
 		SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
 		InvalidateWindowData(WC_VEHICLE_REFIT, this->index, VIWD_CONSIST_CHANGED);
+		InvalidateWindowData(WC_VEHICLE_ORDERS, this->index, VIWD_CONSIST_CHANGED);
 	}
 }