MichaelJW / DorsalVR

VR interface for PC games
69 stars 7 forks source link

Configuration files are parsed without taking into account different CultureInfos #17

Open artumino opened 2 years ago

artumino commented 2 years ago

Hey, I was trying to get Dorsal working but couldn't see any screen.

Looking at the code I found the source of the issue: https://github.com/MichaelJW/DorsalVR/blob/16b3e157eb48e4d6496ff6a0bd69167084d94ed8/Assets/Config/ConfigLoader.cs#L335 https://github.com/MichaelJW/DorsalVR/blob/16b3e157eb48e4d6496ff6a0bd69167084d94ed8/Assets/Config/ConfigLoader.cs#L341

When reading floats from the yamls you use Convert.ToSingle uses the system's cultureinfo when parsing strings which means that for example on Italian systems would parse 1.2 as 12. Adding CultureInfo.InvariantCulture as additional argument solves the issue.

I saw that in version 3.0 lua will be used for configs so this probably won't be an issue.

MichaelJW commented 2 years ago

@artumino Thank you for diagnosing that, that's really helpful! I will check that the new Lua system takes this into account.