(svn r11996) -Fix [FS#1706]: update train statusbar when stopping from zero speed
authorsmatz
Sun, 27 Jan 2008 20:20:53 +0000
changeset 8922 88bec308f864
parent 8921 6d9c1a813d88
child 8923 7bc318982e2c
(svn r11996) -Fix [FS#1706]: update train statusbar when stopping from zero speed
src/train_cmd.cpp
--- a/src/train_cmd.cpp	Sun Jan 27 17:34:08 2008 +0000
+++ b/src/train_cmd.cpp	Sun Jan 27 20:20:53 2008 +0000
@@ -3523,6 +3523,12 @@
 	if (!mode) HandleLocomotiveSmokeCloud(v);
 
 	int j = UpdateTrainSpeed(v);
+
+	/* we need to invalidate the widget if we are stopping from 'Stopping 0 km/h' to 'Stopped' */
+	if (v->cur_speed == 0 && v->u.rail.last_speed == 0 && v->vehstatus & VS_STOPPED) {
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
+	}
+
 	if (j == 0) {
 		/* if the vehicle has speed 0, update the last_speed field. */
 		if (v->cur_speed != 0) return;