1
0
Fork 0

Launcher: Fix cast of helipd to runway

Should fix trying to retrieve an ILS from a pad.
This commit is contained in:
James Turner 2020-07-17 12:04:12 +01:00
parent ae094f9a77
commit f5f3054a7a

View file

@ -973,14 +973,17 @@ void LocationController::onCollectConfig()
if (m_airportLocation->type() == FGPositioned::AIRPORT) {
m_config->setArg("runway", QString::fromStdString(m_detailLocation->ident()));
if (ty == FGPositioned::RUNWAY) {
// set nav-radio 1 based on selected runway
FGRunway* runway = static_cast<FGRunway*>(m_detailLocation.ptr());
auto runway = fgpositioned_cast<FGRunway>(m_detailLocation);
if (runway->ILS()) {
double mhz = runway->ILS()->get_freq() / 100.0;
m_config->setArg("nav1", QString("%1:%2").arg(runway->headingDeg()).arg(mhz));
}
applyOnFinal();
}
} else if (m_airportLocation->type() == FGPositioned::HELIPORT) {
m_config->setArg("runway", QString::fromStdString(m_detailLocation->ident()));
}