1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +02:00

Teleport: check immunities in applicable()

Attempt to fix #2677
This commit is contained in:
Konstantin P
2023-08-31 17:59:50 +03:00
parent 7255dda624
commit 08967efd91

View File

@@ -49,7 +49,7 @@ void Teleport::adjustTargetTypes(std::vector<TargetType> & types) const
bool Teleport::applicable(Problem & problem, const Mechanics * m, const EffectTarget & target) const
{
if(target.size() == 1) //Assume, this is check only for selecting a unit
return UnitEffect::applicable(problem, m);
return UnitEffect::applicable(problem, m, target);
if(target.size() != 2)
return m->adaptProblem(ESpellCastProblem::WRONG_SPELL_TARGET, problem);