1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

get rid of CBattleInfoCallback::battleCanCastThisSpell

This commit is contained in:
AlexVinS
2017-06-05 23:46:55 +03:00
parent 6c308956f9
commit 195e979a18
7 changed files with 30 additions and 44 deletions

View File

@@ -194,8 +194,7 @@ void CBattleAI::attemptCastingSpell()
std::vector<const CSpell*> possibleSpells;
vstd::copy_if(VLC->spellh->objects, std::back_inserter(possibleSpells), [this, hero] (const CSpell *s) -> bool
{
auto problem = getCbc()->battleCanCastThisSpell(hero, s, ECastingMode::HERO_CASTING);
return problem == ESpellCastProblem::OK;
return s->canBeCast(getCbc().get(), ECastingMode::HERO_CASTING, hero) == ESpellCastProblem::OK;
});
LOGFL("I can cast %d spells.", possibleSpells.size());