(svn r24246) -Add [FS#5052-ish]: [NewGRF] Variable with the current max speed for vehicles.

This commit is contained in:
michi_cc
2012-05-14 19:56:49 +00:00
parent 58d474797e
commit ce5c936b07
5 changed files with 14 additions and 0 deletions

View File

@@ -369,6 +369,8 @@ int Train::GetCurveSpeedLimit() const
*/
int Train::GetCurrentMaxSpeed() const
{
if (_settings_game.vehicle.train_acceleration_model == AM_ORIGINAL) return min(this->gcache.cached_max_track_speed, this->current_order.max_speed);
int max_speed = this->tcache.cached_max_curve_speed;
assert(max_speed == this->GetCurveSpeedLimit());