Splitscreen disconnection fix + mob null pointer checks.

This commit is contained in:
E x o t i c 2026-03-09 10:52:57 -04:00 committed by GitHub
parent bda3b1078a
commit dbbae5f455
2 changed files with 2 additions and 5 deletions

View file

@ -2427,6 +2427,7 @@ void ClientConnection::handleAddMob(shared_ptr<AddMobPacket> packet)
float xRot = packet->xRot * 360 / 256.0f;
shared_ptr<LivingEntity> mob = dynamic_pointer_cast<LivingEntity>(EntityIO::newById(packet->type, level));
if (mob == nullptr) return;
mob->xp = packet->x;
mob->yp = packet->y;
mob->zp = packet->z;

View file

@ -299,11 +299,7 @@ IQNetPlayer* IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex)
}
return nullptr;
}
// Split-screen pads 1-3: the player is at m_player[dwUserIndex] with isRemote=false
if (dwUserIndex < MINECRAFT_NET_MAX_PLAYERS &&
!m_player[dwUserIndex].m_isRemote &&
Win64_IsActivePlayer(&m_player[dwUserIndex], dwUserIndex))
return &m_player[dwUserIndex];
// Split-screen pads 1-3 only work in hosting mode
return nullptr;
}
static bool Win64_IsActivePlayer(IQNetPlayer * p, DWORD index)