mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
Remove no longer needed (and incomplete) explicit target existence check
This commit is contained in:
parent
6356247108
commit
46e7a0f829
@ -178,24 +178,6 @@ void DispellMechanics::applyBattle(BattleInfo * battle, const BattleSpellCast *
|
||||
}
|
||||
}
|
||||
|
||||
ESpellCastProblem::ESpellCastProblem DispellMechanics::canBeCasted(const CBattleInfoCallback * cb, PlayerColor player) const
|
||||
{
|
||||
//todo: check for lower level
|
||||
|
||||
std::stringstream cachingStr;
|
||||
cachingStr << "source_" << Bonus::SPELL_EFFECT;
|
||||
|
||||
for(const CStack * s : cb->battleAliveStacks())
|
||||
{
|
||||
if(s->hasBonus(Selector::sourceType(Bonus::SPELL_EFFECT), cachingStr.str()))
|
||||
{
|
||||
return ESpellCastProblem::OK;
|
||||
}
|
||||
}
|
||||
|
||||
return ESpellCastProblem::NO_APPROPRIATE_TARGET;
|
||||
}
|
||||
|
||||
ESpellCastProblem::ESpellCastProblem DispellMechanics::isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const
|
||||
{
|
||||
//DISPELL ignores all immunities, so do not call default
|
||||
|
@ -51,7 +51,6 @@ public:
|
||||
ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override;
|
||||
|
||||
void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const override final;
|
||||
ESpellCastProblem::ESpellCastProblem canBeCasted(const CBattleInfoCallback * cb, PlayerColor player) const override;
|
||||
protected:
|
||||
void applyBattleEffects(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters, SpellCastContext & ctx) const override;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user