Browse Source

Battle AI: archangels cast again

Andrii Danylchenko 2 năm trước cách đây
mục cha
commit
a7859dae39
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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)
 	{