From d59a1fe9e9f518f9397a20709c5c68f8bf05aff0 Mon Sep 17 00:00:00 2001 From: Xilmi Date: Mon, 30 Sep 2024 17:57:41 +0200 Subject: [PATCH] Fix case of "Got false in applying struct CastAdvSpell" Heroes now leave the garrison before trying (and failing) to cast adventure-map-spells. --- AI/Nullkiller/Goals/AdventureSpellCast.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AI/Nullkiller/Goals/AdventureSpellCast.cpp b/AI/Nullkiller/Goals/AdventureSpellCast.cpp index 1868d7c60..8e8df0241 100644 --- a/AI/Nullkiller/Goals/AdventureSpellCast.cpp +++ b/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;