fix(vm): coerce ini_write_string value to string - #416
Open
qum1nzhennan wants to merge 1 commit into
Open
Conversation
Native GameMaker converts the value argument to a string regardless of its type. Butterscotch silently persisted an empty string for any non-string value, which broke the Chinese patch name-translation toggle in Deltarune: the numeric global.names was written, then read back as 0 by ini_read_real. Use RValue_toString like the neighboring ini_write_real builtin. Fixes ButterscotchRunner#415
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.
Fixes #415.
ini_write_string()silently persisted an empty string whenever the third argument was not already anRVALUE_STRING. Native GameMaker converts any value to a string, so GML likeini_write_string("S", "K", 123)must persistK="123", but Butterscotch wroteK="".This broke the Chinese community patch for DELTARUNE: its in-game name-translation toggle writes the numeric
global.namesviaini_write_string, then immediately reads it back withini_read_real, so the value always round-tripped as 0 and the option appeared dead.The fix converts the value with
RValue_toString, mirroring the neighboringini_write_realbuiltin.