1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Battle AI: archangels cast again

This commit is contained in:
Andrii Danylchenko 2023-08-12 22:08:15 +03:00
parent 1eabb738dc
commit a7859dae39

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)
{