Ver código fonte

Update DefenceBehavior.cpp

Stop iterating over tasks when the curent hero has been found in one.
Xilmi 10 meses atrás
pai
commit
2df9861076
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      AI/Nullkiller/Behaviors/DefenceBehavior.cpp

+ 3 - 0
AI/Nullkiller/Behaviors/DefenceBehavior.cpp

@@ -425,7 +425,10 @@ void DefenceBehavior::evaluateRecruitingHero(Goals::TGoalVec & tasks, const HitM
 				if (auto recruitGoal = dynamic_cast<Goals::RecruitHero*>(task.get())) 
 				{
 					if (recruitGoal->getHero() == hero)
+					{
 						heroAlreadyHiredInOtherTown = true;
+						break;
+					}
 				}
 			}
 			if (heroAlreadyHiredInOtherTown)