diff options
author | tron <tron@openttd.org> | 2005-06-03 22:25:06 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-06-03 22:25:06 +0000 |
commit | 80aa6af8e38801c943de92f83a76a7021b1a0ed8 (patch) | |
tree | 5484880f706f6da66643d2195ceac3a975b2026b | |
parent | 92b79ecf9509a43d7a9d55701b41c6528e77b74e (diff) | |
download | openttd-80aa6af8e38801c943de92f83a76a7021b1a0ed8.tar.xz |
(svn r2403) if cascade -> switch
-rw-r--r-- | aircraft_cmd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/aircraft_cmd.c b/aircraft_cmd.c index 68a404b27..1d4b29c1a 100644 --- a/aircraft_cmd.c +++ b/aircraft_cmd.c @@ -823,12 +823,11 @@ static bool UpdateAircraftSpeed(Vehicle *v) // get Aircraft running altitude static byte GetAircraftFlyingAltitude(const Vehicle *v) { - byte maxz = 162; - if (v->max_speed != 37) { - maxz = 171; - if (v->max_speed != 74) {maxz = 180;} + switch (v->max_speed) { + case 37: return 162; + case 74: return 171; + default: return 180; } - return maxz; } static bool AircraftController(Vehicle *v) |