This commit is contained in:
AlexVinS authored and Andrii Danylchenko committed 2021-07-26 21:02:50 +03:00
1 parent fa39279c82
commit dd046e60be
1 file changed
+3
@@ -44,6 +44,9 @@ TSubgoal AdventureSpellCast::whatToDoToAchieve()
if(hero->mana < hero->getSpellCost(spell))
throw cannotFulfillGoalException("Hero has not enough mana to cast " + spell->name);
if(spellID == SpellID::TOWN_PORTAL && town && town->visitingHero)
throw cannotFulfillGoalException("The town is already occupied by " + town->visitingHero->name);
return iAmElementar();
}