# HG changeset patch
# User HackaLittleBit
# Date 1390761589 0
#      Sun Jan 26 18:39:49 2014 +0000
# Node ID 9a4ee646c72de303a274435e7e941b1c134e66b2
# Parent  e63749dcd2b14a19ed92c1ef915194785f59abdf
Code cleanup - GetAircraftFlyingAltitude is left for backwards compatability only
Altidude will is handled elseware.

diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -668,39 +668,13 @@
 }
 
 /**
- * Gets the cruise altitude of an aircraft.
- * The cruise altitude is determined by the velocity of the vehicle
- * and the direction it is moving
+ * Gets the minimum altitude of an aircraft left in for backwards compatibility.
  * @param v The vehicle. Should be an aircraft
  * @returns Altitude in pixel units
  */
 int GetAircraftFlyingAltitude(const Aircraft *v)
 {
-	if (v->subtype == AIR_HELICOPTER) return MIN_FLIGHT_ALTITUDE;
-
-	/* Make sure Aircraft fly no lower so that they don't conduct
-	 * CFITs (controlled flight into terrain)
-	 */
-	int base_altitude = MIN_FLIGHT_ALTITUDE;
-
-	/* Make sure eastbound and westbound planes do not "crash" into each
-	 * other by providing them with vertical separation
-	 */
-	switch (v->direction) {
-		case DIR_N:
-		case DIR_NE:
-		case DIR_E:
-		case DIR_SE:
-			base_altitude += 10;
-			break;
-
-		default: break;
-	}
-
-	/* Make faster planes fly higher so that they can overtake slower ones */
-	base_altitude += min(20 * (v->vcache.cached_max_speed / 200), 90);
-
-	return base_altitude;
+	return MIN_FLIGHT_ALTITUDE;
 }
 
 /**
@@ -822,7 +796,7 @@
 			count = UpdateAircraftSpeed(v);
 			if (count > 0) {
 				v->tile = 0;
-				int z_dest = GetAircraftFlyingAltitude(v);
+				int z_dest = HELI_FLIGHT_ALTITUDE;
 
 				/* Reached altitude? */
 				if (v->z_pos >= z_dest) {
