From b4a9d7621597c9eef97f8ec84d246d5585b4b7ea Mon Sep 17 00:00:00 2001 From: david Date: Wed, 20 Feb 2002 00:20:13 +0000 Subject: [PATCH] Fixed runway-altitude problem that prevented starts at airports higher than sea-level. --- src/FDM/YASim/YASim.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/FDM/YASim/YASim.cxx b/src/FDM/YASim/YASim.cxx index 55c67366c..de2ba71fc 100644 --- a/src/FDM/YASim/YASim.cxx +++ b/src/FDM/YASim/YASim.cxx @@ -162,7 +162,9 @@ void YASim::init() // Are we at ground level? If so, lift the plane up so the gear // clear the ground - if(get_Altitude() - get_Runway_altitude() < 50) { + double runway_altitude = + fgGetDouble("/environment/ground-elevation-m") * SG_METER_TO_FEET; + if(get_Altitude() - runway_altitude < 50) { float minGearZ = 1e18; for(i=0; inumGear(); i++) { Gear* g = a->getGear(i); @@ -171,7 +173,7 @@ void YASim::init() if(pos[2] < minGearZ) minGearZ = pos[2]; } - _set_Altitude(get_Runway_altitude() - minGearZ*M2FT); + _set_Altitude(runway_altitude - minGearZ*M2FT); } // The pilot's eyepoint