From 9855e89109d8c44dd9a9c967dc187c8c4e4f3650 Mon Sep 17 00:00:00 2001 From: Automatic Release Builder Date: Tue, 27 Oct 2020 19:24:13 +0000 Subject: [PATCH] Launcher: Validate restored aircraft state on load Otherwise a stray state can enter the logic, unless the user re-selects it. --- src/GUI/LauncherController.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/GUI/LauncherController.cxx b/src/GUI/LauncherController.cxx index 6d51bed12..13eaffeeb 100644 --- a/src/GUI/LauncherController.cxx +++ b/src/GUI/LauncherController.cxx @@ -457,6 +457,13 @@ void LauncherController::updateSelectedAircraft() } } + if (!m_aircraftState.isEmpty()) { + if (!m_selectedAircraftInfo->hasState(m_aircraftState)) { + m_aircraftState.clear(); + emit selectedAircraftStateChanged(); + } + } + emit canFlyChanged(); }