Warning: I2localization can interfere with parsing

More
2 years 7 months ago - 2 years 7 months ago #1892 by kylerwk
Just wanted to bring up the fact that a change that was made to I2 Localization has been causing us some issues that we wouldn't have ever anticipated.

Our game saves and loads various types of files and uses functions like
Parsing.ParseFloat(attr.Value);

This was all working well for us, except we found out that I2 localization was changing
System.Threading.Thread.CurrentThread.CurrentCulture
when the player changed the games language.

This caused the Parsing function to change how it handles commas and periods in decimal numbers, causing all sorts of different types of bugs.

Our solution is is to use
Parsing.ParseFloat_InvariantCulture (attr.Value);
so that the CurrentCulture doesn't effect anything else.

Just wanted to give everyone and the devs of I2 a heads up that this plugins updates can have far reaching on code it isn't really connected to.
Last edit: 2 years 7 months ago by kylerwk.

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #1893 by Frank
Hi,
Sorry for this issue, You can download 2.6.9a2 which has a fix for that, or do the changes listed in this post:
inter-illusion.com/forum/i2-localization...tion-of-scripts#1887

Thanks,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

Time to create page: 0.115 seconds
Template by JoomlaShine