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