(svn r10984) -Codechange: unify the way one can get the current speed in the same forwat so we can display it.

This commit is contained in:
rubidium
2007-08-26 20:43:22 +00:00
parent a83ccad6bd
commit a5b32d8d72
10 changed files with 26 additions and 16 deletions

View File

@@ -297,14 +297,14 @@ static void RoadVehViewWndProc(Window *w, WindowEvent *e)
switch (v->current_order.type) {
case OT_GOTO_STATION: {
SetDParam(0, v->current_order.dest);
SetDParam(1, v->cur_speed * 10 / 32);
SetDParam(1, v->GetDisplaySpeed());
str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
} break;
case OT_GOTO_DEPOT: {
Depot *depot = GetDepot(v->current_order.dest);
SetDParam(0, depot->town_index);
SetDParam(1, v->cur_speed * 10 / 32);
SetDParam(1, v->GetDisplaySpeed());
if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS)) {
str = STR_HEADING_FOR_ROAD_DEPOT + _patches.vehicle_speed;
} else {
@@ -320,7 +320,7 @@ static void RoadVehViewWndProc(Window *w, WindowEvent *e)
default:
if (v->num_orders == 0) {
str = STR_NO_ORDERS + _patches.vehicle_speed;
SetDParam(0, v->cur_speed * 10 / 32);
SetDParam(0, v->GetDisplaySpeed());
} else {
str = STR_EMPTY;
}