Skip to content

fix(vm): coerce ini_write_string value to string - #416

Open
qum1nzhennan wants to merge 1 commit into
ButterscotchRunner:mainfrom
qum1nzhennan:fix-ini-write-string
Open

fix(vm): coerce ini_write_string value to string#416
qum1nzhennan wants to merge 1 commit into
ButterscotchRunner:mainfrom
qum1nzhennan:fix-ini-write-string

Conversation

@qum1nzhennan

Copy link
Copy Markdown

Fixes #415.

ini_write_string() silently persisted an empty string whenever the third argument was not already an RVALUE_STRING. Native GameMaker converts any value to a string, so GML like ini_write_string("S", "K", 123) must persist K="123", but Butterscotch wrote K="".

This broke the Chinese community patch for DELTARUNE: its in-game name-translation toggle writes the numeric global.names via ini_write_string, then immediately reads it back with ini_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 neighboring ini_write_real builtin.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ini_write_string silently writes empty string for non-string values

1 participant