Преглед изворни кода

Battle AI: archangels cast again

Andrii Danylchenko пре 2 година
родитељ
комит
a7859dae39
1 измењених фајлова са 4 додато и 0 уклоњено
  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));
 	TConstBonusListPtr bl = caster->getBonuses(Selector::type()(BonusType::SPELLCASTER));
 	if (!bl->size())
 	if (!bl->size())
 		return SpellID::NONE;
 		return SpellID::NONE;
+
+	if(bl->size() == 1)
+		return SpellID(bl->front()->subtype);
+
 	int totalWeight = 0;
 	int totalWeight = 0;
 	for(const auto & b : *bl)
 	for(const auto & b : *bl)
 	{
 	{