From 8d16167bdbb2fa11eb3d5810177c3ad66da187ff Mon Sep 17 00:00:00 2001 From: blong Date: Tue, 10 Mar 2026 23:33:35 +0000 Subject: [PATCH] Fixed issue with world seeds not saving correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fix issue where typing in a short seed on world creation doesn't save the seed correctly ## Changes ### Previous Behavior Typing in a seed on the world creation menu that's less than 8 characters long will result in garbage data being saved as the seed. Happens with controller and KBM. You can see this in-game - if you exit the world options menu and go back in, the seed will show up as boxes □□□. Weirdly, if you type a seed again, it behaves as expected. ### Root Cause For some reason, assigning `m_params->seed` to the seed text points it to garbage data, when it's 7 characters or less. ### New Behavior Seed entry behaves as expected. ### Fix Implementation - Added `static_cast` before assignment to `m_params->seed`. - Also replaced `(wchar_t *)` with `reinterpret_cast` in the functions. ### AI Use Disclosure No AI was used --- .../Common/UI/UIScene_LaunchMoreOptionsMenu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp index b2981ebf6..1832e40cb 100644 --- a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp @@ -557,8 +557,8 @@ int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,b uint16_t pchText[128]; ZeroMemory(pchText, 128 * sizeof(uint16_t)); Win64_GetKeyboardText(pchText, 128); - pClass->m_editSeed.setLabel((wchar_t *)pchText); - pClass->m_params->seed = (wchar_t *)pchText; + pClass->m_editSeed.setLabel(reinterpret_cast(pchText)); + pClass->m_params->seed = static_cast(reinterpret_cast(pchText)); #else #ifdef __PSVITA__ uint16_t pchText[2048]; @@ -584,7 +584,7 @@ void UIScene_LaunchMoreOptionsMenu::getDirectEditInputs(vectorseed = input->getEditBuffer(); + m_params->seed = static_cast(input->getEditBuffer()); } #endif