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-10-02 11:58:22 +03:00
parent bccb82ffcb
commit affbc71c56

View File

@ -1714,17 +1714,12 @@ ESpellCastProblem::ESpellCastProblem CBattleInfoCallback::battleCanCastThisSpell
if(!spell->combatSpell)
return ESpellCastProblem::ADVMAP_SPELL_INSTEAD_OF_BATTLE_SPELL;
const ESpellCastProblem::ESpellCastProblem specificProblem = spell->canBeCast(this, mode, caster);
if(specificProblem != ESpellCastProblem::OK)
return specificProblem;
//effect like Recanter's Cloak. Blocks also passive casting.
//TODO: check creature abilities to block
if(battleMaxSpellLevel(side) < spell->level)
return ESpellCastProblem::SPELL_LEVEL_LIMIT_EXCEEDED;
return ESpellCastProblem::OK;
return spell->canBeCast(this, mode, caster);
}
ui32 CBattleInfoCallback::battleGetSpellCost(const CSpell * sp, const CGHeroInstance * caster) const