mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
vcmi: no open-code NO_APPROPRIATE_TARGET
This commit is contained in:
parent
e2596accc7
commit
e40b9c849d
@ -76,12 +76,7 @@ bool Sacrifice::applicable(Problem & problem, const Mechanics * m) const
|
||||
}
|
||||
|
||||
if(!(targetExists && targetToSacrificeExists))
|
||||
{
|
||||
MetaString text;
|
||||
text.addTxt(MetaString::GENERAL_TXT, 185);
|
||||
problem.add(std::move(text), Problem::NORMAL);
|
||||
return false;
|
||||
}
|
||||
return m->adaptProblem(ESpellCastProblem::NO_APPROPRIATE_TARGET, problem);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -46,13 +46,7 @@ bool UnitEffect::applicable(Problem & problem, const Mechanics * m) const
|
||||
auto targets = m->battle()->battleGetUnitsIf(mainFilter);
|
||||
vstd::erase_if(targets, predicate);
|
||||
if(targets.empty())
|
||||
{
|
||||
MetaString text;
|
||||
text.addTxt(MetaString::GENERAL_TXT, 185);
|
||||
problem.add(std::move(text), Problem::NORMAL);
|
||||
return false;
|
||||
}
|
||||
|
||||
return m->adaptProblem(ESpellCastProblem::NO_APPROPRIATE_TARGET, problem);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user