pull in project-slippi/Ishiiruka/commit/dd0677d5d2dfcc976671dff779160c26cb420d0d

This commit is contained in:
Nikhil Narayana 2022-05-29 23:08:03 -07:00
commit cdef62f577

View file

@ -2302,19 +2302,30 @@ void CEXISlippi::prepareOnlineMatchState()
} }
} }
// Overwrite local player character // Check if everyone is the same color
onlineMatchBlock[0x60 + (lps.playerIdx) * 0x24] = lps.characterId; auto color = orderedSelections[0].teamId;
onlineMatchBlock[0x63 + (lps.playerIdx) * 0x24] = lps.characterColor; bool areAllSameTeam = true;
onlineMatchBlock[0x67 + (lps.playerIdx) * 0x24] = 0; for (const auto& s : orderedSelections)
onlineMatchBlock[0x69 + (lps.playerIdx) * 0x24] = lps.teamId;
// Overwrite remote player character
for (int i = 0; i < remotePlayerCount; i++)
{ {
u8 idx = rps[i].playerIdx; if (s.teamId != color)
onlineMatchBlock[0x60 + idx * 0x24] = rps[i].characterId; areAllSameTeam = false;
onlineMatchBlock[0x63 + idx * 0x24] = rps[i].characterColor; }
onlineMatchBlock[0x69 + idx * 0x24] = rps[i].teamId;
// Overwrite player character choices
for (auto& s : orderedSelections)
{
if (areAllSameTeam)
{
// Overwrite teamId
// TODO: overwrite color
s.teamId = s.playerIdx <= 1 ? 0 : 1;
}
// Overwrite player character
onlineMatchBlock[0x60 + (s.playerIdx) * 0x24] = s.characterId;
onlineMatchBlock[0x63 + (s.playerIdx) * 0x24] = s.characterColor;
onlineMatchBlock[0x67 + (s.playerIdx) * 0x24] = 0;
onlineMatchBlock[0x69 + (s.playerIdx) * 0x24] = s.teamId;
} }
// Handle Singles/Teams specific logic // Handle Singles/Teams specific logic