mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Splitscreen disconnection fix + mob null pointer checks.
This commit is contained in:
parent
bda3b1078a
commit
dbbae5f455
|
|
@ -2427,6 +2427,7 @@ void ClientConnection::handleAddMob(shared_ptr<AddMobPacket> packet)
|
||||||
float xRot = packet->xRot * 360 / 256.0f;
|
float xRot = packet->xRot * 360 / 256.0f;
|
||||||
|
|
||||||
shared_ptr<LivingEntity> mob = dynamic_pointer_cast<LivingEntity>(EntityIO::newById(packet->type, level));
|
shared_ptr<LivingEntity> mob = dynamic_pointer_cast<LivingEntity>(EntityIO::newById(packet->type, level));
|
||||||
|
if (mob == nullptr) return;
|
||||||
mob->xp = packet->x;
|
mob->xp = packet->x;
|
||||||
mob->yp = packet->y;
|
mob->yp = packet->y;
|
||||||
mob->zp = packet->z;
|
mob->zp = packet->z;
|
||||||
|
|
|
||||||
|
|
@ -299,11 +299,7 @@ IQNetPlayer* IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex)
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
// Split-screen pads 1-3: the player is at m_player[dwUserIndex] with isRemote=false
|
// Split-screen pads 1-3 only work in hosting mode
|
||||||
if (dwUserIndex < MINECRAFT_NET_MAX_PLAYERS &&
|
|
||||||
!m_player[dwUserIndex].m_isRemote &&
|
|
||||||
Win64_IsActivePlayer(&m_player[dwUserIndex], dwUserIndex))
|
|
||||||
return &m_player[dwUserIndex];
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
static bool Win64_IsActivePlayer(IQNetPlayer * p, DWORD index)
|
static bool Win64_IsActivePlayer(IQNetPlayer * p, DWORD index)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue