浏览代码

Remove no longer needed (and incomplete) explicit target existence check

AlexVinS 10 年之前
父节点
当前提交
46e7a0f829
共有 2 个文件被更改,包括 0 次插入19 次删除
  1. 0 18
      lib/spells/BattleSpellMechanics.cpp
  2. 0 1
      lib/spells/BattleSpellMechanics.h

+ 0 - 18
lib/spells/BattleSpellMechanics.cpp

@@ -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

+ 0 - 1
lib/spells/BattleSpellMechanics.h

@@ -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;
 };