mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-01 14:45:42 +08:00
[FS9] Weather grid checks
This commit is contained in:
committed by
Mat Sutcliffe
parent
a0b8fbd158
commit
90e77ac9f1
@@ -461,10 +461,15 @@ namespace BlackSimPlugin
|
|||||||
m_fsuipc->setSimulatorTime(h, m);
|
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_useFsuipc || !m_fsuipc) { return; }
|
||||||
if (!m_fsuipc->isOpened()) { return; }
|
if (!m_fsuipc->isOpened()) { return; }
|
||||||
|
if (weatherGrid.isEmpty())
|
||||||
|
{
|
||||||
|
CLogMessage(this).info(u"Empty FS9 weather grid");
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_fsuipc->write(weatherGrid);
|
m_fsuipc->write(weatherGrid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ namespace BlackSimPlugin
|
|||||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||||
if (!this->isOpened()) { return false; }
|
if (!this->isOpened()) { return false; }
|
||||||
|
|
||||||
|
if (weatherGrid.isEmpty()) { return false; }
|
||||||
this->clearAllWeather();
|
this->clearAllWeather();
|
||||||
CGridPoint gridPoint = weatherGrid.front();
|
CGridPoint gridPoint = weatherGrid.front();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user