From 32eec3ebf1c2ea44fbff7cafe660d45c709665e8 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Mon, 15 Jan 2024 21:17:31 +0800 Subject: [PATCH] Fix random_shuffle compile error --- src/RandomPlayerbotMgr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index 1b8aef8f..28cd3fc2 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -33,6 +33,7 @@ #include #include #include +#include void PrintStatsThread() { @@ -368,7 +369,8 @@ uint32 RandomPlayerbotMgr::AddRandomBots() guids.push_back(guid); } while (result->NextRow()); - std::random_shuffle(guids.begin(), guids.end()); + std::mt19937 rnd(time(0)); + std::shuffle(guids.begin(), guids.end(), rnd); for (uint32 &guid : guids) { uint32 add_time = sPlayerbotAIConfig->enableRotation ?