2
0
Эх сурвалжийг харах

Fix case of "Got false in applying struct CastAdvSpell"

Heroes now leave the garrison before trying (and failing) to cast adventure-map-spells.
Xilmi 1 жил өмнө
parent
commit
d59a1fe9e9

+ 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());
 	}
 
+	if (hero->inTownGarrison)
+		ai->myCb->swapGarrisonHero(hero->visitedTown);
+
 	auto wait = cb->waitTillRealize;
 
 	cb->waitTillRealize = true;