(svn r2347) - Fix (regression): depot window did not get redrawn when a non-train-engine was sold.
authorDarkvater
Tue, 17 May 2005 23:08:21 +0000
changeset 1842 7efaede8ac8e
parent 1841 b41b821d9a23
child 1843 733f83b6483a
(svn r2347) - Fix (regression): depot window did not get redrawn when a non-train-engine was sold.
train_cmd.c
--- a/train_cmd.c	Tue May 17 20:59:29 2005 +0000
+++ b/train_cmd.c	Tue May 17 23:08:21 2005 +0000
@@ -932,9 +932,11 @@
 	// make sure the vehicle is stopped in the depot
 	if (CheckTrainStoppedInDepot(first) < 0) return CMD_ERROR;
 
-	if ((flags & DC_EXEC) && v == first && first->subtype == TS_Front_Engine) {
-		DeleteWindowById(WC_VEHICLE_VIEW, first->index);
-		InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train);
+	if (flags & DC_EXEC) {
+		if (v == first && first->subtype == TS_Front_Engine) {
+			DeleteWindowById(WC_VEHICLE_VIEW, first->index);
+			InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train);
+		}
 		InvalidateWindow(WC_VEHICLE_DEPOT, first->tile);
 		RebuildVehicleLists();
 	}