mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-25 19:55:50 +00:00
pull in project-slippi/Ishiiruka/commit/55086d48543c922d32dd2519da425a61d96efdef
This commit is contained in:
parent
cdef62f577
commit
b0849e6fbc
1 changed files with 10 additions and 7 deletions
|
@ -2302,6 +2302,10 @@ void CEXISlippi::prepareOnlineMatchState()
|
|||
}
|
||||
}
|
||||
|
||||
// Set rng offset
|
||||
rngOffset = isDecider ? lps.rngOffset : rps[0].rngOffset;
|
||||
INFO_LOG(SLIPPI_ONLINE, "Rng Offset: 0x%x", rngOffset);
|
||||
|
||||
// Check if everyone is the same color
|
||||
auto color = orderedSelections[0].teamId;
|
||||
bool areAllSameTeam = true;
|
||||
|
@ -2311,6 +2315,11 @@ 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);
|
||||
|
||||
// Overwrite player character choices
|
||||
for (auto& s : orderedSelections)
|
||||
{
|
||||
|
@ -2318,7 +2327,7 @@ void CEXISlippi::prepareOnlineMatchState()
|
|||
{
|
||||
// Overwrite teamId
|
||||
// TODO: overwrite color
|
||||
s.teamId = s.playerIdx <= 1 ? 0 : 1;
|
||||
s.teamId = teamAssignments[s.playerIdx];
|
||||
}
|
||||
|
||||
// Overwrite player character
|
||||
|
@ -2354,12 +2363,6 @@ void CEXISlippi::prepareOnlineMatchState()
|
|||
onlineMatchBlock[0x61 + 3 * 0x24] = 0;
|
||||
}
|
||||
|
||||
// Set rng offset
|
||||
rngOffset = isDecider ? lps.rngOffset : rps[0].rngOffset;
|
||||
WARN_LOG(SLIPPI_ONLINE, "Rng Offset: 0x%x", rngOffset);
|
||||
WARN_LOG(SLIPPI_ONLINE, "P1 Char: 0x%X, P2 Char: 0x%X", onlineMatchBlock[0x60],
|
||||
onlineMatchBlock[0x84]);
|
||||
|
||||
// Turn pause off in unranked/ranked, on in other modes
|
||||
u8* gameBitField3 = static_cast<u8*>(&onlineMatchBlock[2]);
|
||||
*gameBitField3 = SlippiMatchmaking::IsFixedRulesMode(lastSearch.mode) ? *gameBitField3 | 0x8 :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue