mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Fixed #1342. Animate Dead won't affect living creatures.
This commit is contained in:
@@ -281,6 +281,9 @@ bool CSpell::isImmuneBy(const IBonusBearer* obj) const
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj->hasBonusOfType(Bonus::NEGATE_ALL_NATURAL_IMMUNITIES)) //Orb of vulnerability
|
||||
return false; //TODO: some creaures are unaffected always, for example undead to resurrection.
|
||||
|
||||
for(auto b : immunities)
|
||||
{
|
||||
if (obj->hasBonusOfType(b))
|
||||
@@ -322,10 +325,6 @@ bool CSpell::isImmuneBy(const IBonusBearer* obj) const
|
||||
}
|
||||
|
||||
TBonusListPtr levelImmunities = obj->getBonuses(Selector::type(Bonus::LEVEL_SPELL_IMMUNITY));
|
||||
if(obj->hasBonusOfType(Bonus::NEGATE_ALL_NATURAL_IMMUNITIES))
|
||||
{
|
||||
levelImmunities->remove_if([](const Bonus* b){ return b->source == Bonus::CREATURE_ABILITY; });
|
||||
}
|
||||
|
||||
if(obj->hasBonusOfType(Bonus::SPELL_IMMUNITY, id)
|
||||
|| ( levelImmunities->size() > 0 && levelImmunities->totalValue() >= level && level))
|
||||
|
Reference in New Issue
Block a user