1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Show correct error message on attempting to cast Remove Obstacle on

fields with no removable obstacles
This commit is contained in:
Ivan Savenko 2022-12-02 00:27:48 +02:00
parent 215932b520
commit d8742dac3f

View File

@ -43,7 +43,10 @@ RemoveObstacle::~RemoveObstacle() = default;
bool RemoveObstacle::applicable(Problem & problem, const Mechanics * m) const
{
return !getTargets(m, EffectTarget(), true).empty();
if (getTargets(m, EffectTarget(), true).empty())
{
return m->adaptProblem(ESpellCastProblem::NO_APPROPRIATE_TARGET, problem);
}
}
bool RemoveObstacle::applicable(Problem & problem, const Mechanics * m, const EffectTarget & target) const