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

Parsing for CREATURE_TYPE_LIMITER

This commit is contained in:
DjWarmonger
2013-01-18 11:49:15 +00:00
parent ce15eb37c2
commit 97db289d3c
3 changed files with 18 additions and 2 deletions

View File

@@ -1053,8 +1053,18 @@ Bonus * JsonUtils::parseBonus (const JsonNode &ability)
shared_ptr<ILimiter> l;
if (limiter["type"].String() == "CREATURE_TYPE_LIMITER")
{
//continue;
//l = make_shared<CCreatureTypeLimiter>(); //TODO: How the hell resolve pointer to creature?
shared_ptr<CCreatureTypeLimiter> l2 = make_shared<CCreatureTypeLimiter>(); //TODO: How the hell resolve pointer to creature?
const JsonVector vec = limiter["parameters"].Vector();
VLC->modh->identifiers.requestIdentifier(std::string("creature.") + vec[0].String(), [=](si32 creature)
{
l2->setCreature (creature);
});
if (vec.size() > 1)
{
l2->includeUpgrades = vec[1].Bool();
}
else
l2->includeUpgrades = false;
}
if (limiter["type"].String() == "HAS_ANOTHER_BONUS_LIMITER")
{