Browse Source

Fix hero limit check in AI

Ivan Savenko 1 year ago
parent
commit
60ca6f968c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      AI/Nullkiller/Analyzers/HeroManager.cpp

+ 2 - 1
AI/Nullkiller/Analyzers/HeroManager.cpp

@@ -187,7 +187,8 @@ bool HeroManager::heroCapReached() const
 	int heroCount = cb->getHeroCount(ai->playerID, includeGarnisoned);
 
 	return heroCount >= ALLOWED_ROAMING_HEROES
-		|| heroCount >= VLC->settings()->getInteger(EGameSettings::HEROES_PER_PLAYER_ON_MAP_CAP);
+		|| heroCount >= VLC->settings()->getInteger(EGameSettings::HEROES_PER_PLAYER_ON_MAP_CAP)
+		|| heroCount >= VLC->settings()->getInteger(EGameSettings::HEROES_PER_PLAYER_TOTAL_CAP);
 }
 
 float HeroManager::getMagicStrength(const CGHeroInstance * hero) const