aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp
diff options
context:
space:
mode:
authorblongm <33197955+blongm@users.noreply.github.com>2026-03-30 11:05:32 +0000
committerGitHub <noreply@github.com>2026-03-30 06:05:32 -0500
commitd3412aaae731c219e5b41574ea1ba924b003b3a8 (patch)
treeadc8a55e3d03d50737df98a00598452db7adc706 /Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp
parent38d58f2d8bb8af5516671b42940279d4e582d9c7 (diff)
Fixed issue with world seeds not saving correctly (#1119)main
## 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<wstring>` before assignment to `m_params->seed`. - Also replaced `(wchar_t *)` with `reinterpret_cast<wchar_t*>` in the functions. ### AI Use Disclosure No AI was used
Diffstat (limited to 'Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp')
-rw-r--r--Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp
index b2981ebf..1832e40c 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<wchar_t*>(pchText));
+ pClass->m_params->seed = static_cast<wstring>(reinterpret_cast<wchar_t*>(pchText));
#else
#ifdef __PSVITA__
uint16_t pchText[2048];
@@ -584,7 +584,7 @@ void UIScene_LaunchMoreOptionsMenu::getDirectEditInputs(vector<UIControl_TextInp
void UIScene_LaunchMoreOptionsMenu::onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result)
{
if (result == UIControl_TextInput::eDirectEdit_Confirmed)
- m_params->seed = input->getEditBuffer();
+ m_params->seed = static_cast<wstring>(input->getEditBuffer());
}
#endif