From 22d885af223fd18f18422028b9bcab07b108ff37 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Tue, 1 Mar 2016 15:14:27 +0300 Subject: [PATCH] Fixed http://bugs.vcmi.eu/view.php?id=2302 --- lib/spells/BattleSpellMechanics.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/spells/BattleSpellMechanics.cpp b/lib/spells/BattleSpellMechanics.cpp index e90822e35..5d930e310 100644 --- a/lib/spells/BattleSpellMechanics.cpp +++ b/lib/spells/BattleSpellMechanics.cpp @@ -346,6 +346,11 @@ ESpellCastProblem::ESpellCastProblem EarthquakeMechanics::canBeCast(const CBattl return ESpellCastProblem::NO_APPROPRIATE_TARGET; } + const auto attackableBattleHexes = cb->getAttackableBattleHexes(); + + if(attackableBattleHexes.empty()) + return ESpellCastProblem::NO_APPROPRIATE_TARGET; + return ESpellCastProblem::OK; }