*Use function RandomResizeList to resize spell target list.
--HG-- branch : trunk
This commit is contained in:
+1
-8
@@ -2016,14 +2016,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
||||
if(m_spellInfo->Id == 5246) //Intimidating Shout
|
||||
TagUnitMap.remove(m_targets.getUnitTarget());
|
||||
|
||||
// remove random units from the map
|
||||
std::list<Unit*>::iterator itr;
|
||||
while(TagUnitMap.size() > unMaxTargets)
|
||||
{
|
||||
itr = TagUnitMap.begin();
|
||||
advance(itr, urand(0, TagUnitMap.size() - 1));
|
||||
TagUnitMap.erase(itr);
|
||||
}
|
||||
Trinity::RandomResizeList(TagUnitMap, unMaxTargets);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user