[FS9] Weather grid checks

This commit is contained in:
Klaus Basan
2020-04-10 13:59:22 +02:00
committed by Mat Sutcliffe
parent a0b8fbd158
commit 90e77ac9f1
2 changed files with 7 additions and 1 deletions

View File

@@ -461,10 +461,15 @@ namespace BlackSimPlugin
m_fsuipc->setSimulatorTime(h, m);
}
void CSimulatorFs9::injectWeatherGrid(const Weather::CWeatherGrid &weatherGrid)
void CSimulatorFs9::injectWeatherGrid(const CWeatherGrid &weatherGrid)
{
if (!m_useFsuipc || !m_fsuipc) { return; }
if (!m_fsuipc->isOpened()) { return; }
if (weatherGrid.isEmpty())
{
CLogMessage(this).info(u"Empty FS9 weather grid");
return;
}
m_fsuipc->write(weatherGrid);
}

View File

@@ -199,6 +199,7 @@ namespace BlackSimPlugin
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
if (!this->isOpened()) { return false; }
if (weatherGrid.isEmpty()) { return false; }
this->clearAllWeather();
CGridPoint gridPoint = weatherGrid.front();