summaryrefslogtreecommitdiff
path: root/src/train_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-26 20:43:22 +0000
committerrubidium <rubidium@openttd.org>2007-08-26 20:43:22 +0000
commita5b32d8d7238ae769a9dc3bcc71aaaba213058b9 (patch)
tree774788b69d486a12f8c1135fa3ca8e087d508d2a /src/train_gui.cpp
parenta83ccad6bd289715da504f9ab514ac781ece5608 (diff)
downloadopenttd-a5b32d8d7238ae769a9dc3bcc71aaaba213058b9.tar.xz
(svn r10984) -Codechange: unify the way one can get the current speed in the same forwat so we can display it.
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r--src/train_gui.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index 1c1c731e0..b61c1c598 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -179,14 +179,14 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
} else if (v->breakdown_ctr == 1) {
str = STR_885C_BROKEN_DOWN;
} else if (v->vehstatus & VS_STOPPED) {
- if (v->u.rail.last_speed == 0) {
+ if (v->cur_speed == 0) {
if (v->u.rail.cached_power == 0) {
str = STR_TRAIN_NO_POWER;
} else {
str = STR_8861_STOPPED;
}
} else {
- SetDParam(0, v->u.rail.last_speed * 10 / 16);
+ SetDParam(0, v->GetDisplaySpeed());
str = STR_TRAIN_STOPPING + _patches.vehicle_speed;
}
} else {
@@ -194,7 +194,7 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
case OT_GOTO_STATION: {
str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
SetDParam(0, v->current_order.dest);
- SetDParam(1, v->u.rail.last_speed * 10 / 16);
+ SetDParam(1, v->GetDisplaySpeed());
} break;
case OT_GOTO_DEPOT: {
@@ -205,7 +205,7 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
} else {
str = STR_HEADING_FOR_TRAIN_DEPOT_SERVICE + _patches.vehicle_speed;
}
- SetDParam(1, v->u.rail.last_speed * 10 / 16);
+ SetDParam(1, v->GetDisplaySpeed());
} break;
case OT_LOADING:
@@ -216,14 +216,14 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
case OT_GOTO_WAYPOINT: {
SetDParam(0, v->current_order.dest);
str = STR_HEADING_FOR_WAYPOINT + _patches.vehicle_speed;
- SetDParam(1, v->u.rail.last_speed * 10 / 16);
+ SetDParam(1, v->GetDisplaySpeed());
break;
}
default:
if (v->num_orders == 0) {
str = STR_NO_ORDERS + _patches.vehicle_speed;
- SetDParam(0, v->u.rail.last_speed * 10 / 16);
+ SetDParam(0, v->GetDisplaySpeed());
} else {
str = STR_EMPTY;
}