Fix XUID assignment for split-screen local players

Main's XUID refactor returned INVALID_XUID for pad != 0, which breaks
split-screen because each local player needs a distinct identity for
the save system and per-player inventory data.

Now pad 1-3 get unique XUIDs derived from the legacy embedded base
(base + iPad), same as the original console behavior. Only pad 0
uses the persistent uid.dat-backed XUID for networking.
This commit is contained in:
MrTheShy 2026-03-07 02:12:17 +01:00
parent 6bc39f8eac
commit 1b131ef7c1

View file

@ -606,18 +606,15 @@ bool C_4JProfile::QuerySigninStatus(void) { return true; }
void C_4JProfile::GetXUID(int iPad, PlayerUID * pXuid, bool bOnlineXuid) void C_4JProfile::GetXUID(int iPad, PlayerUID * pXuid, bool bOnlineXuid)
{ {
#ifdef _WINDOWS64 #ifdef _WINDOWS64
if (iPad != 0) // Split-screen local players (pad 1-3) need unique XUIDs derived from the
{ // legacy base so the save system and per-player data can tell them apart.
*pXuid = INVALID_XUID; // Only pad 0 participates in networking with a "real" identity.
return;
}
// LoginPacket reads this value as client identity:
// - host keeps legacy host XUID for world compatibility
// - non-host uses persistent uid.dat-backed XUID
if (IQNet::s_isHosting) if (IQNet::s_isHosting)
*pXuid = Win64Xuid::GetLegacyEmbeddedHostXuid(); *pXuid = Win64Xuid::GetLegacyEmbeddedHostXuid() + iPad;
else else if (iPad == 0)
*pXuid = Win64Xuid::ResolvePersistentXuid(); *pXuid = Win64Xuid::ResolvePersistentXuid();
else
*pXuid = Win64Xuid::GetLegacyEmbeddedBaseXuid() + iPad;
#else #else
* pXuid = 0xe000d45248242f2e + iPad; * pXuid = 0xe000d45248242f2e + iPad;
#endif #endif