1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Merge pull request #2572 from vcmi/nkai-fix-heroes-not-recruiting

Nkai fix heroes not recruiting
This commit is contained in:
Andrii Danylchenko 2023-08-14 21:40:53 +03:00 committed by GitHub
commit 6c025fd768
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -84,7 +84,7 @@ Goals::TGoalVec RecruitHeroBehavior::decompose() const
}
}
if(treasureSourcesCount < 5)
if(treasureSourcesCount < 5 && (town->garrisonHero || town->getUpperArmy()->getArmyStrength() < 10000))
continue;
if(cb->getHeroesInfo().size() < cb->getTownsInfo().size() + 1

View File

@ -1732,6 +1732,10 @@ SpellID CBattleInfoCallback::getRandomCastedSpell(CRandomGenerator & rand,const
TConstBonusListPtr bl = caster->getBonuses(Selector::type()(BonusType::SPELLCASTER));
if (!bl->size())
return SpellID::NONE;
if(bl->size() == 1)
return SpellID(bl->front()->subtype);
int totalWeight = 0;
for(const auto & b : *bl)
{