mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
refs #848, check flags for FSUIPC parts before using them
This commit is contained in:
committed by
Mathew Sutcliffe
parent
c609c555b4
commit
4f1dc00d67
@@ -1055,19 +1055,20 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorFsx::injectWeatherGrid(const Weather::CWeatherGrid &weatherGrid)
|
||||
{
|
||||
if (!m_useFsuipc || !m_fsuipc) { return; }
|
||||
if (!m_fsuipc->isConnected()) { return; }
|
||||
m_fsuipc->write(weatherGrid);
|
||||
}
|
||||
|
||||
void CSimulatorFsx::reloadWeatherSettings()
|
||||
{
|
||||
if (m_fsuipc->isConnected())
|
||||
if (!m_useFsuipc || !m_fsuipc) { return; }
|
||||
if (!m_fsuipc->isConnected()) { return; }
|
||||
const auto selectedWeatherScenario = m_weatherScenarioSettings.get();
|
||||
if (!CWeatherScenario::isRealWeatherScenario(selectedWeatherScenario))
|
||||
{
|
||||
auto selectedWeatherScenario = m_weatherScenarioSettings.get();
|
||||
if (!CWeatherScenario::isRealWeatherScenario(selectedWeatherScenario))
|
||||
{
|
||||
m_lastWeatherPosition = {};
|
||||
injectWeatherGrid(CWeatherGrid::getByScenario(selectedWeatherScenario));
|
||||
}
|
||||
m_lastWeatherPosition = {};
|
||||
injectWeatherGrid(CWeatherGrid::getByScenario(selectedWeatherScenario));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user