1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00
This commit is contained in:
AlexVinS
2019-02-24 18:45:53 +03:00
parent 1855af9ed3
commit f36a86412e

View File

@@ -44,6 +44,9 @@ TSubgoal AdventureSpellCast::whatToDoToAchieve()
if(hero->mana < hero->getSpellCost(spell)) if(hero->mana < hero->getSpellCost(spell))
throw cannotFulfillGoalException("Hero has not enough mana to cast " + spell->name); 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(); return iAmElementar();
} }