1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

[Spells] Get rid of SpellTargetingContext.

This commit is contained in:
AlexVinS
2017-07-16 00:49:59 +03:00
parent 7374689301
commit f1a4831813
6 changed files with 70 additions and 95 deletions

View File

@@ -243,8 +243,7 @@ std::vector<BattleHex> CSpell::rangeInHexes(BattleHex centralHex, ui8 schoolLvl,
std::vector<const CStack *> CSpell::getAffectedStacks(const CBattleInfoCallback * cb, ECastingMode::ECastingMode mode, const ISpellCaster * caster, int spellLvl, BattleHex destination) const
{
SpellTargetingContext ctx(this, mode, caster, spellLvl, destination);
return mechanics->getAffectedStacks(cb, ctx);
return mechanics->getAffectedStacks(cb, mode, caster, spellLvl, destination);
}
CSpell::ETargetType CSpell::getTargetType() const
@@ -405,9 +404,7 @@ ESpellCastProblem::ESpellCastProblem CSpell::canBeCastAt(const CBattleInfoCallba
if(problem != ESpellCastProblem::OK)
return problem;
SpellTargetingContext ctx(this, mode, caster, caster->getSpellSchoolLevel(this), destination);
return mechanics->canBeCast(cb, ctx);
return mechanics->canBeCastAt(cb, mode, caster, destination);
}
int CSpell::adjustRawDamage(const ISpellCaster * caster, const CStack * affectedCreature, int rawDamage) const