Explorar o código

Battle AI: archangels cast again

Andrii Danylchenko %!s(int64=2) %!d(string=hai) anos
pai
achega
a7859dae39
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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)
 	{