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:
@@ -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));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user