1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-13 11:40:38 +02:00

Fixed CID 1366292

This commit is contained in:
AlexVinS 2016-11-26 21:11:21 +03:00
parent 121dd6c63a
commit 7d2874bf12

View File

@ -1731,7 +1731,12 @@ ESpellCastProblem::ESpellCastProblem CBattleInfoCallback::battleCanCastThisSpell
case ECastingMode::HERO_CASTING:
{
const CGHeroInstance * castingHero = dynamic_cast<const CGHeroInstance *>(caster);//todo: unify hero|creature spell cost
assert(castingHero);
if(!castingHero)
{
logGlobal->error("battleCanCastThisSpell: invalid caster");
return ESpellCastProblem::INVALID;
}
if(!castingHero->getArt(ArtifactPosition::SPELLBOOK))
return ESpellCastProblem::NO_SPELLBOOK;
if(!castingHero->canCastThisSpell(spell))