mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-30 08:57:00 +02:00
Show correct error message on attempting to cast Remove Obstacle on
fields with no removable obstacles
This commit is contained in:
parent
215932b520
commit
d8742dac3f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user