diff options
author | celestar <celestar@openttd.org> | 2005-01-26 12:51:04 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2005-01-26 12:51:04 +0000 |
commit | efcd72a2efdc04c87e4ea579355a446b65c0f9fb (patch) | |
tree | 784d57ba7b91c2bfec65ea76c4fafdbd9668f83a /train_gui.c | |
parent | 5665d51bb31bd2c8860e9b48989fa145ad01e193 (diff) | |
download | openttd-efcd72a2efdc04c87e4ea579355a446b65c0f9fb.tar.xz |
(svn r1681) -Feature: New realistic acceleration.
This will make things more difficult as narrow curves
and depots impose rather strict speed limits. Feedback welcome
For those who don't like low-speed curves: Switch it off
Diffstat (limited to 'train_gui.c')
-rw-r--r-- | train_gui.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/train_gui.c b/train_gui.c index 12037c418..15e17ceb4 100644 --- a/train_gui.c +++ b/train_gui.c @@ -1011,6 +1011,7 @@ static void DrawTrainDetailsWindow(Window *w) { Vehicle *v, *u; uint16 tot_cargo[NUM_CARGO][2]; // count total cargo ([0]-actual cargo, [1]-total cargo) + int max_speed = 0xFFFF; int i,num,x,y,sel; StringID str; byte det_tab = WP(w, traindetails_d).tab; @@ -1030,6 +1031,8 @@ static void DrawTrainDetailsWindow(Window *w) tot_cargo[u->cargo_type][0] += u->cargo_count; tot_cargo[u->cargo_type][1] += u->cargo_cap; } + if (RailVehInfo(u->engine_type)->max_speed != 0) + max_speed = min(max_speed, RailVehInfo(u->engine_type)->max_speed); } while ( (u = u->next) != NULL); /* set scroll-amount seperately from counting, as to not @@ -1072,7 +1075,7 @@ static void DrawTrainDetailsWindow(Window *w) SetDParam(3, GetTrainRunningCost(v) >> 8); DrawString(x, 15, STR_885D_AGE_RUNNING_COST_YR, 0); - SetDParam(2, v->max_speed * 10 >> 4); + SetDParam(2, max_speed * 10 >> 4); SetDParam(1, v->u.rail.cached_power); SetDParam(0, v->u.rail.cached_weight); DrawString(x, 25, STR_885E_WEIGHT_T_POWER_HP_MAX_SPEED, 0); |