Ver Fonte

Fix case of "Got false in applying struct CastAdvSpell"

Heroes now leave the garrison before trying (and failing) to cast adventure-map-spells.
Xilmi há 1 ano atrás
pai
commit
d59a1fe9e9
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      AI/Nullkiller/Goals/AdventureSpellCast.cpp

+ 3 - 0
AI/Nullkiller/Goals/AdventureSpellCast.cpp

@@ -53,6 +53,9 @@ void AdventureSpellCast::accept(AIGateway * ai)
 			throw cannotFulfillGoalException("The town is already occupied by " + town->visitingHero->getNameTranslated());
 			throw cannotFulfillGoalException("The town is already occupied by " + town->visitingHero->getNameTranslated());
 	}
 	}
 
 
+	if (hero->inTownGarrison)
+		ai->myCb->swapGarrisonHero(hero->visitedTown);
+
 	auto wait = cb->waitTillRealize;
 	auto wait = cb->waitTillRealize;
 
 
 	cb->waitTillRealize = true;
 	cb->waitTillRealize = true;