Misc/Util: Add a template function for returning a random element from any container
This commit is contained in:
1 parent
8504a0107e
commit
7afb179185
23 files changed
+44
-96
No files matched your search
@@ -251,10 +251,9 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader
|
||||
return;
|
||||
}
|
||||
|
||||
std::list<Unit*>::const_iterator it2 = tempTargets.begin();
|
||||
std::advance(it2, urand(0, tempTargets.size() - 1));
|
||||
Unit* target = SelectRandomContainerElement(tempTargets);
|
||||
unitList.clear();
|
||||
unitList.push_back(*it2);
|
||||
unitList.push_back(target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user