mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	NullkillerAI: fix build analyser when town has no upgrade for creature
This commit is contained in:
		| @@ -194,7 +194,9 @@ BuildingInfo BuildAnalyzer::getBuildingOrPrerequisite( | ||||
| 	{ | ||||
| 		int level = toBuild - BuildingID::DWELL_FIRST; | ||||
| 		auto creatures = townInfo->creatures.at(level % GameConstants::CREATURES_PER_TOWN); | ||||
| 		auto creatureID = creatures.at(level / GameConstants::CREATURES_PER_TOWN); | ||||
| 		auto creatureID = creatures.size() > level / GameConstants::CREATURES_PER_TOWN | ||||
| 			? creatures.at(level / GameConstants::CREATURES_PER_TOWN) | ||||
| 			: creatures.front(); | ||||
|  | ||||
| 		baseCreatureID = creatures.front(); | ||||
| 		creature = creatureID.toCreature(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user