diff --git a/src/Viewer/view.cxx b/src/Viewer/view.cxx index 355ace49c..cb640ef75 100644 --- a/src/Viewer/view.cxx +++ b/src/Viewer/view.cxx @@ -1000,17 +1000,9 @@ View::recalcLookAt () SGGeodesy::SGCartToGeod(targetCart2, _target); _position = _target; - - const std::string& tail = ViewPropertyEvaluator::getStringValue("(/sim/view[(/sim/current-view/view-number-raw)]/config/eye-lon-deg-path)"); - - if (tail != "") { - /* will typically be /sim/tower/longitude-deg, so that this view's - eye position is from the tower rather than relative to the aircraft. - If we are viewing a multiplayer aircraft, the nearest tower - will be in /sim/view[]/config/root/sim/tower/longitude-deg (see - FGEnvironmentMgr::updateClosestAirport()), so we use a prefix to select - either /sim/tower/longitude-deg or multiplayer's tower. */ + bool eye_fixed = ViewPropertyEvaluator::getBoolValue("(/sim/view[(/sim/current-view/view-number-raw)]/config/eye-fixed)"); + if (eye_fixed) { _position.setLongitudeDeg( ViewPropertyEvaluator::getDoubleValue( "((/sim/view[(/sim/current-view/view-number-raw)]/config/root)(/sim/view[(/sim/current-view/view-number-raw)]/config/eye-lon-deg-path))",