mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
make sonar cloud (a little bit) happy
This commit is contained in:
@@ -481,36 +481,36 @@ void Campaign::overrideCampaign(bool scenario)
|
||||
{
|
||||
JsonNode node = JsonUtils::assembleFromFiles("config/campaignOverrides.json");
|
||||
for (auto & entry : node.Struct())
|
||||
if(filename == entry.first)
|
||||
{
|
||||
if(!scenario)
|
||||
if(filename == entry.first)
|
||||
{
|
||||
if(!entry.second["regions"].isNull() && !entry.second["scenarioCount"].isNull())
|
||||
loadLegacyData(CampaignRegions::fromJson(entry.second["regions"]), entry.second["scenarioCount"].Integer());
|
||||
if(!entry.second["loadingBackground"].isNull())
|
||||
loadingBackground = ImagePath::builtin(entry.second["loadingBackground"].String());
|
||||
if(!entry.second["introVideoRim"].isNull())
|
||||
introVideoRim = ImagePath::builtin(entry.second["introVideoRim"].String());
|
||||
if(!entry.second["introVideo"].isNull())
|
||||
introVideo = VideoPath::builtin(entry.second["introVideo"].String());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!entry.second["scenarios"].isNull())
|
||||
if(!scenario)
|
||||
{
|
||||
auto sc = entry.second["scenarios"].Vector();
|
||||
for(int i = 0; i < sc.size(); i++)
|
||||
if(!entry.second["regions"].isNull() && !entry.second["scenarioCount"].isNull())
|
||||
loadLegacyData(CampaignRegions::fromJson(entry.second["regions"]), entry.second["scenarioCount"].Integer());
|
||||
if(!entry.second["loadingBackground"].isNull())
|
||||
loadingBackground = ImagePath::builtin(entry.second["loadingBackground"].String());
|
||||
if(!entry.second["introVideoRim"].isNull())
|
||||
introVideoRim = ImagePath::builtin(entry.second["introVideoRim"].String());
|
||||
if(!entry.second["introVideo"].isNull())
|
||||
introVideo = VideoPath::builtin(entry.second["introVideo"].String());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!entry.second["scenarios"].isNull())
|
||||
{
|
||||
auto it = scenarios.begin();
|
||||
std::advance(it, i);
|
||||
if(!sc.at(i)["voiceProlog"].isNull())
|
||||
it->second.prolog.prologVoice = AudioPath::builtin(sc.at(i)["voiceProlog"].String());
|
||||
if(!sc.at(i)["voiceEpilog"].isNull())
|
||||
it->second.epilog.prologVoice = AudioPath::builtin(sc.at(i)["voiceEpilog"].String());
|
||||
auto sc = entry.second["scenarios"].Vector();
|
||||
for(int i = 0; i < sc.size(); i++)
|
||||
{
|
||||
auto it = scenarios.begin();
|
||||
std::advance(it, i);
|
||||
if(!sc.at(i)["voiceProlog"].isNull())
|
||||
it->second.prolog.prologVoice = AudioPath::builtin(sc.at(i)["voiceProlog"].String());
|
||||
if(!sc.at(i)["voiceEpilog"].isNull())
|
||||
it->second.epilog.prologVoice = AudioPath::builtin(sc.at(i)["voiceEpilog"].String());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Campaign::scenariosCount() const
|
||||
|
||||
Reference in New Issue
Block a user