(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.
This commit is contained in:
hackykid
2005-06-05 15:37:00 +00:00
parent b30a413cfe
commit e878e4d815
5 changed files with 92 additions and 55 deletions

View File

@@ -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;