Fixed issue with world seeds not saving correctly#1119
Open
blongm wants to merge 1 commit intosmartcmd:mainfrom
Open
Fixed issue with world seeds not saving correctly#1119blongm wants to merge 1 commit intosmartcmd:mainfrom
blongm wants to merge 1 commit intosmartcmd:mainfrom
Conversation
## 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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->seedto the seed text points it to garbage data, when it's 7 characters or less.New Behavior
Seed entry behaves as expected.
Fix Implementation
static_cast<wstring>before assignment tom_params->seed.(wchar_t *)withreinterpret_cast<wchar_t*>in the functions.AI Use Disclosure
No AI was used