mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fixed access to unitialized memory causing StupidAI to act stupid
This commit is contained in:
		| @@ -153,6 +153,12 @@ BattleAction CStupidAI::activeStack( const CStack * stack ) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	for ( auto & enemy : enemiesReachable ) | ||||
| 		enemy.calcDmg( stack ); | ||||
|  | ||||
| 	for ( auto & enemy : enemiesShootable ) | ||||
| 		enemy.calcDmg( stack ); | ||||
|  | ||||
| 	if(enemiesShootable.size()) | ||||
| 	{ | ||||
| 		const EnemyInfo &ei= *std::max_element(enemiesShootable.begin(), enemiesShootable.end(), isMoreProfitable); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user