1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
This commit is contained in:
AlexVinS 2016-09-30 01:54:40 +03:00
parent 84fc8770e9
commit 8aa31f4073

View File

@ -53,10 +53,19 @@ void AntimagicMechanics::applyBattle(BattleInfo * battle, const BattleSpellCast
doDispell(battle, packet, [this](const Bonus *b) -> bool
{
if(b->source == Bonus::SPELL_EFFECT)
const CSpell * sourceSpell = b->sourceSpell();
if(sourceSpell != nullptr)
{
return b->sid != owner->id; //effect from this spell
//keep positive effects
if(sourceSpell->isPositive())
return false;
//keep own effects
if(sourceSpell == owner)
return false;
//remove all others
return true;
}
return false; //not a spell effect
});
}