diff options
author | smatz <smatz@openttd.org> | 2008-01-27 20:20:53 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-01-27 20:20:53 +0000 |
commit | c8ba8d930b8d0faf522315e2afc2e4d604060b5e (patch) | |
tree | 62043a84bcd6ed27e3cb9116d08605721f97e1a8 | |
parent | c5b81c93821301ba752377e2f22c4fe1fd84d450 (diff) | |
download | openttd-c8ba8d930b8d0faf522315e2afc2e4d604060b5e.tar.xz |
(svn r11996) -Fix [FS#1706]: update train statusbar when stopping from zero speed
-rw-r--r-- | src/train_cmd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 1308d5757..891642070 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -3523,6 +3523,12 @@ static void TrainLocoHandler(Vehicle *v, bool mode) 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; |