Bläddra i källkod

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 år sedan
förälder
incheckning
d59a1fe9e9
1 ändrade filer med 3 tillägg och 0 borttagningar
  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());
 	}
 
+	if (hero->inTownGarrison)
+		ai->myCb->swapGarrisonHero(hero->visitedTown);
+
 	auto wait = cb->waitTillRealize;
 
 	cb->waitTillRealize = true;