blob: 9ecc171de28a6cdb6a5a18d9814d47fb12084493 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
--- AI/Skirmish/CircuitAI/src/circuit/setup/SetupManager.cpp.orig 2021-01-01 16:10:55 UTC
+++ AI/Skirmish/CircuitAI/src/circuit/setup/SetupManager.cpp
@@ -26,6 +26,8 @@
#include "Info.h"
#include <regex>
+#include <algorithm>
+#include <random>
namespace circuit {
@@ -183,7 +185,9 @@ void CSetupManager::PickStartPos(CCircuitAI* circuit,
c.distDivIncome = center.distance(cl.position) / income;
validClusters.push_back(std::make_pair(kv.first, c));
}
- std::random_shuffle(validClusters.begin(), validClusters.end());
+ std::random_device rd;
+ std::minstd_rand g(rd());
+ std::shuffle(validClusters.begin(), validClusters.end(), g);
auto cmp = [](const std::pair<int, SCluster>& a, const std::pair<int, SCluster>& b) {
if (a.second.count < b.second.count) {
|