mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Style, commend - requested
This commit is contained in:
		
				
					committed by
					
						 Andrii Danylchenko
						Andrii Danylchenko
					
				
			
			
				
	
			
			
			
						parent
						
							22b4795f86
						
					
				
				
					commit
					40585a66c0
				
			| @@ -299,7 +299,13 @@ float RewardEvaluator::getEnemyHeroStrategicalValue(const CGHeroInstance * enemy | ||||
| 		vstd::amax(objectValue, getStrategicalValue(obj)); | ||||
| 	} | ||||
|  | ||||
| 	//AI should absolutely prioritize killing enemy heroes, even scouts | ||||
| 	/* | ||||
| 	  1. If an enemy hero can attack nearby object, it's not useful to capture the object on our own. | ||||
| 	  Killing the hero is almost as important (0.9) as capturing the object itself. | ||||
|  | ||||
| 	  2. The formula quickly approaches 1.0 as hero level increases, | ||||
| 	  but higher level always means higher value and the minimal value for level 1 hero is 0.5 | ||||
| 	*/ | ||||
| 	return std::min(1.0f, objectValue * 0.9f + (1.0f - (1.0f / (1 + enemy->level)))); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -5583,10 +5583,7 @@ bool CGameHandler::isAllowedExchange(ObjectInstanceID id1, ObjectInstanceID id2) | ||||
| 			auto topArmy = dialog->exchangingArmies.at(0); | ||||
| 			auto bottomArmy = dialog->exchangingArmies.at(1); | ||||
|  | ||||
| 			if (topArmy == o1 && bottomArmy == o2) | ||||
| 				return true; | ||||
|  | ||||
| 			if (bottomArmy == o1 && topArmy == o2) | ||||
| 			if (topArmy == o1 && bottomArmy == o2 || bottomArmy == o1 && topArmy == o2) | ||||
| 				return true; | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user