mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 08:00:48 +01:00
Core/Utils: replaced std::random_shuffle with our own implementation using SFMT random generator
(cherry picked from commit 9e371b766c)
This commit is contained in:
@@ -117,6 +117,19 @@ namespace Trinity
|
||||
return SelectRandomWeightedContainerElement(container, weights);
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn void Trinity::Containers::RandomShuffle(C& container)
|
||||
*
|
||||
* @brief Reorder the elements of the container randomly.
|
||||
*
|
||||
* @param container Container to reorder
|
||||
*/
|
||||
template <class C>
|
||||
void RandomShuffle(C& container)
|
||||
{
|
||||
std::shuffle(container.begin(), container.end(), SFMTEngine::Instance());
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn bool Trinity::Containers::Intersects(Iterator first1, Iterator last1, Iterator first2, Iterator last2)
|
||||
*
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
Sequence[i] = Phase(i);
|
||||
|
||||
/// This ensures a random order and only executes each phase once.
|
||||
std::random_shuffle(Sequence, Sequence + PHASE_GORTOK_PALEHOOF);
|
||||
Trinity::Containers::RandomShuffle(Sequence);
|
||||
|
||||
uiArcingSmashTimer = 15000;
|
||||
uiImpaleTimer = 12000;
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
uint32 uiWhiteringRoarTimer;
|
||||
Phase currentPhase;
|
||||
uint8 AddCount;
|
||||
Phase Sequence[4];
|
||||
std::array<Phase, 4> Sequence;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user