mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fixed AI not taking hero-strength into account when hero is garrisoned.
When evaluating their fighting-chance against towns with a garrisoned hero the AI didn't consider the attribute-boosts of the defending hero. Now it does.
This commit is contained in:
		| @@ -73,6 +73,14 @@ ui64 FuzzyHelper::evaluateDanger(const int3 & tile, const CGHeroInstance * visit | ||||
| 			} | ||||
| 			objectDanger *= ai->heroManager->getFightingStrengthCached(hero); | ||||
| 		} | ||||
| 		if (objWithID<Obj::TOWN>(dangerousObject)) | ||||
| 		{ | ||||
| 			auto town = dynamic_cast<const CGTownInstance*>(dangerousObject); | ||||
| 			auto hero = town->garrisonHero; | ||||
|  | ||||
| 			if (hero) | ||||
| 				objectDanger *= ai->heroManager->getFightingStrengthCached(hero); | ||||
| 		} | ||||
|  | ||||
| 		if(objectDanger) | ||||
| 		{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user