mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +08:00
[Weather] Only send weather if activated
This commit is contained in:
committed by
Mat Sutcliffe
parent
bba07ef4c4
commit
1fb97755ce
@@ -883,10 +883,15 @@ namespace BlackCore
|
|||||||
void CContextSimulator::onWeatherGridReceived(const CWeatherGrid &weatherGrid, const CIdentifier &identifier)
|
void CContextSimulator::onWeatherGridReceived(const CWeatherGrid &weatherGrid, const CIdentifier &identifier)
|
||||||
{
|
{
|
||||||
if (!this->isSimulatorPluginAvailable()) { return; }
|
if (!this->isSimulatorPluginAvailable()) { return; }
|
||||||
if (!m_simulatorPlugin.second) { return; }
|
if (!m_simulatorPlugin.second) { return; }
|
||||||
if (m_simulatorPlugin.second->identifier() == identifier)
|
|
||||||
|
if (m_simulatorPlugin.second && m_simulatorPlugin.second->identifier() == identifier)
|
||||||
{
|
{
|
||||||
m_simulatorPlugin.second->injectWeatherGrid(weatherGrid);
|
// ONLY send if WEATHER is ON
|
||||||
|
if (m_simulatorPlugin.second->isWeatherActivated())
|
||||||
|
{
|
||||||
|
m_simulatorPlugin.second->injectWeatherGrid(weatherGrid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -898,7 +898,8 @@ namespace BlackSimPlugin
|
|||||||
void CSimulatorXPlane::injectWeatherGrid(const CWeatherGrid &weatherGrid)
|
void CSimulatorXPlane::injectWeatherGrid(const CWeatherGrid &weatherGrid)
|
||||||
{
|
{
|
||||||
if (this->isShuttingDownOrDisconnected()) { return; }
|
if (this->isShuttingDownOrDisconnected()) { return; }
|
||||||
if (weatherGrid.isEmpty()) { return; }
|
if (weatherGrid.isEmpty()) { return; }
|
||||||
|
if (!this->isWeatherActivated()) { return; }
|
||||||
|
|
||||||
if (!CThreadUtils::isCurrentThreadObjectThread(this))
|
if (!CThreadUtils::isCurrentThreadObjectThread(this))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user