1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
This commit is contained in:
AlexVinS 2015-09-15 08:51:05 +03:00
parent 017b4c308c
commit 395070b584

View File

@ -500,8 +500,13 @@ bool IBonusBearer::isLiving() const //TODO: theoreticaly there exists "LIVING" b
const TBonusListPtr IBonusBearer::getSpellBonuses() const const TBonusListPtr IBonusBearer::getSpellBonuses() const
{ {
std::stringstream cachingStr; std::stringstream cachingStr;
cachingStr << "source_" << Bonus::SPELL_EFFECT; cachingStr << "!type_" << Bonus::NONE << "source_" << Bonus::SPELL_EFFECT;
return getBonuses(Selector::sourceType(Bonus::SPELL_EFFECT), Selector::anyRange(), cachingStr.str()); CSelector selector = Selector::sourceType(Bonus::SPELL_EFFECT)
.And(CSelector([](const Bonus * b)->bool
{
return !b->type == Bonus::NONE;
}));
return getBonuses(selector, Selector::anyRange(), cachingStr.str());
} }
const Bonus * IBonusBearer::getEffect(ui16 id, int turn /*= 0*/) const const Bonus * IBonusBearer::getEffect(ui16 id, int turn /*= 0*/) const