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:
commit
6c025fd768
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user