|
@@ -192,9 +192,9 @@ void CBattleAI::attemptCastingSpell()
|
|
LOGL("Casting spells sounds like fun. Let's see...");
|
|
LOGL("Casting spells sounds like fun. Let's see...");
|
|
//Get all spells we can cast
|
|
//Get all spells we can cast
|
|
std::vector<const CSpell*> possibleSpells;
|
|
std::vector<const CSpell*> possibleSpells;
|
|
- vstd::copy_if(VLC->spellh->objects, std::back_inserter(possibleSpells), [this] (const CSpell *s) -> bool
|
|
|
|
|
|
+ vstd::copy_if(VLC->spellh->objects, std::back_inserter(possibleSpells), [this, hero] (const CSpell *s) -> bool
|
|
{
|
|
{
|
|
- auto problem = getCbc()->battleCanCastThisSpell(s);
|
|
|
|
|
|
+ auto problem = getCbc()->battleCanCastThisSpell(hero, s, ECastingMode::HERO_CASTING);
|
|
return problem == ESpellCastProblem::OK;
|
|
return problem == ESpellCastProblem::OK;
|
|
});
|
|
});
|
|
LOGFL("I can cast %d spells.", possibleSpells.size());
|
|
LOGFL("I can cast %d spells.", possibleSpells.size());
|