1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Implement async requests for bonus types

This commit is contained in:
Ivan Savenko
2025-06-13 13:29:31 +03:00
parent 54de24c687
commit bc48337445
8 changed files with 58 additions and 58 deletions

View File

@@ -844,11 +844,13 @@ std::shared_ptr<CSpell> CSpellHandler::loadFromJson(const std::string & scope, c
{
for(auto bonusData: json[name].Struct())
{
const std::string bonusId = bonusData.first;
const bool flag = bonusData.second.Bool();
if(!bonusData.second.Bool())
continue;
if(flag)
vec.push_back(LIBRARY->bth->stringToBonus(bonusId));
LIBRARY->identifiers()->requestIdentifier(bonusData.second.getModScope(), "bonus", bonusData.first, [&vec](si32 bonusID)
{
vec.push_back(BonusType(bonusID));
});
}
};