summaryrefslogtreecommitdiff
path: root/economy.c
diff options
context:
space:
mode:
authorhackykid <hackykid@openttd.org>2005-06-05 15:37:00 +0000
committerhackykid <hackykid@openttd.org>2005-06-05 15:37:00 +0000
commite878e4d815232dd94b004938db6054582cb703eb (patch)
tree6e71df41bc09c11b7f906d7ef2ea613673f6e33c /economy.c
parentb30a413cfe1a8f832e41fffd6ece640ccea2cdb1 (diff)
downloadopenttd-e878e4d815232dd94b004938db6054582cb703eb.tar.xz
(svn r2411) - Codechange: Have trains cache stuff like consist power/weight/max speed instead of recalculating it each time.
- Fix: Station ratings now depends on the max speed of a consist, without being affected by other speed limits from realistic acceleration.
Diffstat (limited to 'economy.c')
-rw-r--r--economy.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/economy.c b/economy.c
index 889d7c6bc..6aeec8fa4 100644
--- a/economy.c
+++ b/economy.c
@@ -1405,6 +1405,7 @@ int LoadUnloadVehicle(Vehicle *v)
ge->days_since_pickup = 0;
t = u->max_speed;
if (u->type == VEH_Road) t >>=1;
+ if (u->type == VEH_Train) t = u->u.rail.cached_max_speed;
// if last speed is 0, we treat that as if no vehicle has ever visited the station.
ge->last_speed = t < 255 ? t : 255;