Browse Source

Battle AI: archangels cast again

Andrii Danylchenko 2 years ago
parent
commit
a7859dae39
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lib/battle/CBattleInfoCallback.cpp

+ 4 - 0
lib/battle/CBattleInfoCallback.cpp

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