1
0
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:
DjWarmonger
2013-07-28 10:05:37 +00:00
parent abaa5b1c59
commit 257be7a968
3 changed files with 9 additions and 8 deletions

View File

@@ -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))