mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Update DefenceBehavior.cpp
Stop iterating over tasks when the curent hero has been found in one.
This commit is contained in:
		| @@ -425,7 +425,10 @@ void DefenceBehavior::evaluateRecruitingHero(Goals::TGoalVec & tasks, const HitM | |||||||
| 				if (auto recruitGoal = dynamic_cast<Goals::RecruitHero*>(task.get()))  | 				if (auto recruitGoal = dynamic_cast<Goals::RecruitHero*>(task.get()))  | ||||||
| 				{ | 				{ | ||||||
| 					if (recruitGoal->getHero() == hero) | 					if (recruitGoal->getHero() == hero) | ||||||
|  | 					{ | ||||||
| 						heroAlreadyHiredInOtherTown = true; | 						heroAlreadyHiredInOtherTown = true; | ||||||
|  | 						break; | ||||||
|  | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			if (heroAlreadyHiredInOtherTown) | 			if (heroAlreadyHiredInOtherTown) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user