mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
[FSD] Check attributes of full JSON parts
This commit is contained in:
committed by
Mat Sutcliffe
parent
70c88f0982
commit
4d7468f913
@@ -191,6 +191,9 @@ namespace BlackMisc
|
||||
//! Attribute name
|
||||
static const QString &attributeNameIsFullJson();
|
||||
|
||||
//! Number of attributes for full JSON
|
||||
static constexpr int attributesCountFullJson = 7;
|
||||
|
||||
private:
|
||||
CAircraftLights m_lights;
|
||||
CAircraftEngineList m_engines;
|
||||
|
||||
@@ -422,6 +422,13 @@ namespace BlackMisc
|
||||
{
|
||||
if (isFull)
|
||||
{
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild())
|
||||
{
|
||||
// validation in dev.env.
|
||||
const int attributes = jsonObject.size();
|
||||
const bool correctCount = (attributes == CAircraftParts::attributesCountFullJson);
|
||||
BLACK_VERIFY_X(correctCount, Q_FUNC_INFO, "Wrong full aircraft parts");
|
||||
}
|
||||
parts.convertFromJson(jsonObject);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user