Browse Source

Merge pull request #1241 from trofi/catch-by-reference

AI/Nullkiller/Goals/ExecuteHeroChain.cpp: catch polymorphic exception…
Andrii Danylchenko 2 years ago
parent
commit
c55178e876
1 changed files with 2 additions and 2 deletions
  1. 2 2
      AI/Nullkiller/Goals/ExecuteHeroChain.cpp

+ 2 - 2
AI/Nullkiller/Goals/ExecuteHeroChain.cpp

@@ -127,7 +127,7 @@ void ExecuteHeroChain::accept(AIGateway * ai)
 							continue;
 						}
 					}
-					catch(cannotFulfillGoalException)
+					catch(cannotFulfillGoalException &)
 					{
 						if(!heroPtr.validAndSet())
 						{
@@ -173,7 +173,7 @@ void ExecuteHeroChain::accept(AIGateway * ai)
 			ai->nullkiller->lockHero(hero, HeroLockedReason::HERO_CHAIN);
 			blockedIndexes.insert(node.parentIndex);
 		}
-		catch(goalFulfilledException)
+		catch(goalFulfilledException &)
 		{
 			if(!heroPtr.validAndSet())
 			{