mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
Fix 1974
This commit is contained in:
parent
017b4c308c
commit
395070b584
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user