1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-19 00:17:56 +02:00

get rid of CBattleInfoCallback::battleStackIsImmune

This commit is contained in:
AlexVinS
2014-11-12 09:20:20 +03:00
parent ddf98a5920
commit e4b726151d
5 changed files with 40 additions and 38 deletions

View File

@ -4040,7 +4040,7 @@ void CGameHandler::handleSpellCasting( SpellID spellID, int spellLvl, BattleHex
}
vstd::erase_if(attackedCres,[=](const CStack * s){
return ESpellCastProblem::OK != gs->curB->battleStackIsImmune(caster,spell,mode,s);
return ESpellCastProblem::OK != spell->isImmuneByStack(caster,mode,s);
});
for (auto cre : attackedCres)
@ -4453,7 +4453,7 @@ void CGameHandler::handleSpellCasting( SpellID spellID, int spellLvl, BattleHex
{
if(battleStack->owner == gs->curB->sides.at(casterSide).color) //get enemy stacks which can be affected by this spell
{
if (ESpellCastProblem::OK == gs->curB->battleStackIsImmune(nullptr, spell, ECastingMode::MAGIC_MIRROR, battleStack))
if (ESpellCastProblem::OK == spell->isImmuneByStack(nullptr, ECastingMode::MAGIC_MIRROR, battleStack))
mirrorTargets.push_back(battleStack);
}
}