mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-25 19:55:50 +00:00
pull in project-slippi/Ishiiruka/commit/3a3267c2872c7a1dc198f3508a048d6c4c046bcf
This commit is contained in:
parent
03ce713981
commit
859610e4f7
1 changed files with 9 additions and 4 deletions
|
@ -2315,10 +2315,15 @@ void CEXISlippi::prepareOnlineMatchState()
|
|||
areAllSameTeam = false;
|
||||
}
|
||||
|
||||
// Randomize assignments to randomize teams when all same color
|
||||
std::vector<u8> teamAssignments = {0, 0, 1, 1};
|
||||
generator.seed(rngOffset);
|
||||
std::shuffle(teamAssignments.begin(), teamAssignments.end(), generator);
|
||||
// Choose random team assignments
|
||||
// Previously there was a bug here where the shuffle was not consistent across platforms given
|
||||
// the same seed, this would cause desyncs during cross platform play (different teams). Got
|
||||
// around this by no longer using the shuffle function...
|
||||
std::vector<std::vector<u8>> teamAssignmentPermutations = {
|
||||
{0, 0, 1, 1}, {1, 1, 0, 0}, {0, 1, 1, 0}, {1, 0, 0, 1}, {0, 1, 0, 1}, {1, 0, 1, 0},
|
||||
};
|
||||
auto teamAssignments =
|
||||
teamAssignmentPermutations[rngOffset % teamAssignmentPermutations.size()];
|
||||
|
||||
// Overwrite player character choices
|
||||
for (auto& s : orderedSelections)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue