Skip to content
Permalink
Browse files

Quick fix for https://bugs.vcmi.eu/view.php?id=3041

  • Loading branch information...
alexvins committed Feb 24, 2019
1 parent 1855af9 commit f36a86412e2dfc76af8dd16dc71bb9c29bb10885
Showing with 3 additions and 0 deletions.
  1. +3 −0 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();
}

0 comments on commit f36a864

Please sign in to comment.
You can’t perform that action at this time.