From 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a Mon Sep 17 00:00:00 2001 From: Loki Rautio Date: Sat, 7 Mar 2026 21:12:22 -0600 Subject: Revert "Project modernization (#630)" This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817. --- Minecraft.World/LoginPacket.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Minecraft.World/LoginPacket.cpp') diff --git a/Minecraft.World/LoginPacket.cpp b/Minecraft.World/LoginPacket.cpp index 79cdfbae..44ed62b3 100644 --- a/Minecraft.World/LoginPacket.cpp +++ b/Minecraft.World/LoginPacket.cpp @@ -30,7 +30,7 @@ LoginPacket::LoginPacket() m_playerCapeId = 0; m_isGuest = false; m_newSeaLevel = false; - m_pLevelType = nullptr; + m_pLevelType = NULL; m_uiGamePrivileges = 0; m_xzSize = LEVEL_MAX_WIDTH; m_hellScale = HELL_LEVEL_MAX_SCALE; @@ -59,7 +59,7 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID o m_playerCapeId = capeId; m_isGuest = isGuest; m_newSeaLevel = false; - m_pLevelType = nullptr; + m_pLevelType = NULL; m_uiGamePrivileges = 0; m_xzSize = LEVEL_MAX_WIDTH; m_hellScale = HELL_LEVEL_MAX_SCALE; @@ -100,7 +100,7 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException userName = readUtf(dis, Player::MAX_NAME_LENGTH); wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); - if (m_pLevelType == nullptr) + if (m_pLevelType == NULL) { m_pLevelType = LevelType::lvl_normal; } @@ -135,7 +135,7 @@ void LoginPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(clientVersion); writeUtf(userName, dos); - if (m_pLevelType == nullptr) + if (m_pLevelType == NULL) { writeUtf(L"", dos); } @@ -174,10 +174,10 @@ void LoginPacket::handle(PacketListener *listener) int LoginPacket::getEstimatedSize() { int length=0; - if (m_pLevelType != nullptr) + if (m_pLevelType != NULL) { - length = static_cast(m_pLevelType->getGeneratorName().length()); + length = (int)m_pLevelType->getGeneratorName().length(); } - return static_cast(sizeof(int) + userName.length() + 4 + 6 + sizeof(int64_t) + sizeof(char) + sizeof(int) + (2 * sizeof(PlayerUID)) + 1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int)); + return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(int64_t) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int)); } -- cgit v1.2.3