mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
get rid of CBattleInfoCallback::battleCanCastThisSpellHere
This commit is contained in:
@@ -4458,7 +4458,7 @@ bool CGameHandler::makeCustomAction(BattleAction &ba)
|
||||
if (ba.selectedStack >= 0)
|
||||
parameters.aimToStack(gs->curB->battleGetStackByID(ba.selectedStack, false));
|
||||
|
||||
ESpellCastProblem::ESpellCastProblem escp = gs->curB->battleCanCastThisSpell(h, s, ECastingMode::HERO_CASTING);//todo: should we check aimed cast(battleCanCastThisSpellHere)?
|
||||
ESpellCastProblem::ESpellCastProblem escp = gs->curB->battleCanCastThisSpell(h, s, ECastingMode::HERO_CASTING);//todo: should we check aimed cast?
|
||||
if (escp != ESpellCastProblem::OK)
|
||||
{
|
||||
logGlobal->warn("Spell cannot be cast! Problem: %d", escp);
|
||||
@@ -5300,7 +5300,7 @@ void CGameHandler::attackCasting(const BattleAttack & bat, Bonus::BonusType atta
|
||||
vstd::amin(chance, 100);
|
||||
|
||||
const CSpell * spell = SpellID(spellID).toSpell();
|
||||
if (gs->curB->battleCanCastThisSpellHere(attacker, spell, ECastingMode::AFTER_ATTACK_CASTING, oneOfAttacked->position) != ESpellCastProblem::OK)
|
||||
if(spell->canBeCastAt(gs->curB, attacker, ECastingMode::AFTER_ATTACK_CASTING, oneOfAttacked->position) != ESpellCastProblem::OK)
|
||||
continue;
|
||||
|
||||
//check if spell should be cast (probability handling)
|
||||
|
||||
Reference in New Issue
Block a user