diff --git a/AI/VCAI/Goals/AdventureSpellCast.cpp b/AI/VCAI/Goals/AdventureSpellCast.cpp index befec250d..0db0cca4c 100644 --- a/AI/VCAI/Goals/AdventureSpellCast.cpp +++ b/AI/VCAI/Goals/AdventureSpellCast.cpp @@ -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(); }