1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-16 10:19:47 +02:00

Merge pull request #1737 from rilian-la-te/fix-target-conditions

vcmi: fix target condition regression
This commit is contained in:
Ivan Savenko 2023-03-21 18:42:32 +02:00 committed by GitHub
commit e2596accc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,10 +118,7 @@ protected:
cachingStr << "type_" << Bonus::LEVEL_SPELL_IMMUNITY << "addInfo_1"; cachingStr << "type_" << Bonus::LEVEL_SPELL_IMMUNITY << "addInfo_1";
TConstBonusListPtr levelImmunities = target->getBonuses(Selector::type()(Bonus::LEVEL_SPELL_IMMUNITY).And(Selector::info()(1)), cachingStr.str()); TConstBonusListPtr levelImmunities = target->getBonuses(Selector::type()(Bonus::LEVEL_SPELL_IMMUNITY).And(Selector::info()(1)), cachingStr.str());
return (levelImmunities->size() == 0 || levelImmunities->totalValue() < m->getSpellLevel() || m->getSpellLevel() <= 0);
return levelImmunities->size() == 0 ||
levelImmunities->totalValue() < m->getSpellLevel() ||
m->getSpellLevel() <= 0;
} }
}; };
@ -519,7 +516,7 @@ void TargetCondition::loadConditions(const JsonNode & source, bool exclusive, bo
CModHandler::parseIdentifier(keyValue.first, scope, type, identifier); CModHandler::parseIdentifier(keyValue.first, scope, type, identifier);
std::shared_ptr<TargetConditionItem> item = itemFactory->createConfigurable(scope, type, identifier); item = itemFactory->createConfigurable(scope, type, identifier);
} }
if(item) if(item)