summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-11-08 21:26:32 +0000
committerfrosch <frosch@openttd.org>2010-11-08 21:26:32 +0000
commitb1765482d25751f216bcb01c61ed07d290e4eb26 (patch)
tree89ed028e8421cf17989129419be8a2fee0750398 /src
parentc0ea0ac301b57fb5095151c4416697da91a1253e (diff)
downloadopenttd-b1765482d25751f216bcb01c61ed07d290e4eb26.tar.xz
(svn r21119) -Fix: Helicopter flight altitude was determined inconsistently in different places.
Diffstat (limited to 'src')
-rw-r--r--src/aircraft_cmd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 597bb7ab5..066fe6a8c 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -626,6 +626,8 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE,
*/
byte GetAircraftFlyingAltitude(const Aircraft *v)
{
+ if (v->subtype == AIR_HELICOPTER) return HELI_FLIGHT_ALTITUDE;
+
/* Make sure Aircraft fly no lower so that they don't conduct
* CFITs (controlled flight into terrain)
*/
@@ -768,7 +770,7 @@ static bool AircraftController(Aircraft *v)
count = UpdateAircraftSpeed(v);
if (count > 0) {
v->tile = 0;
- byte z_dest = HELI_FLIGHT_ALTITUDE;
+ byte z_dest = GetAircraftFlyingAltitude(v);
/* Reached altitude? */
if (v->z_pos >= z_dest) {