mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Extract battleStackIsImmune from battleIsImmune
This fix possible problems with rising spells as now immunty is handled on stack level not on hex level * battleIsImmune in now protected - only used in canCastThisSpellHere
This commit is contained in:
@ -4050,7 +4050,7 @@ void CGameHandler::handleSpellCasting( SpellID spellID, int spellLvl, BattleHex
|
||||
}
|
||||
|
||||
vstd::erase_if(attackedCres,[=](const CStack * s){
|
||||
return gs->curB->battleIsImmune(caster,spell,mode,s->position);
|
||||
return ESpellCastProblem::OK != gs->curB->battleStackIsImmune(caster,spell,mode,s);
|
||||
});
|
||||
|
||||
for (auto cre : attackedCres)
|
||||
@ -4463,7 +4463,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 (!gs->curB->battleIsImmune(nullptr, spell, ECastingMode::MAGIC_MIRROR, battleStack->position))
|
||||
if (ESpellCastProblem::OK == gs->curB->battleStackIsImmune(nullptr, spell, ECastingMode::MAGIC_MIRROR, battleStack))
|
||||
mirrorTargets.push_back(battleStack);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user