(svn r21096) -Fix: Display the real max speed for aircrafts instead of always using the engine value.

This commit is contained in:
terkhen
2010-11-06 12:50:34 +00:00
parent cfac2ced69
commit 78d0a1cb1a
3 changed files with 7 additions and 4 deletions

View File

@@ -537,7 +537,8 @@ void UpdateAircraftCache(Aircraft *v)
v->acache.cached_max_speed = max_speed;
} else {
v->acache.cached_max_speed = 0xFFFF;
/* Use the default max speed of the vehicle. */
v->acache.cached_max_speed = v->max_speed;
}
}
@@ -639,7 +640,7 @@ byte GetAircraftFlyingAltitude(const Aircraft *v)
}
/* Make faster planes fly higher so that they can overtake slower ones */
base_altitude += min(20 * (v->max_speed / 200), 90);
base_altitude += min(20 * (v->acache.cached_max_speed / 200), 90);
return base_altitude;
}