Author Topic: [Linux] config resetting each startup  (Read 3925 times)

Bolmaron

  • Posts: 6
  • Maggot Crusher.
    • View Profile
[Linux] config resetting each startup
« on: September 03, 2013, 06:36:07 PM »
Hammerwatch used to make my ears bleed each time I was running it, that's how loud and clipping the music was. It would become less loud after clicking "Options" and then I would go to "Sound" and silence it a bit more. I also needed to change map opacity each time.

So finally I've decided to investigate and the reason turned out to be trivial.

Turns out numbers in config.xml are saved according to locale, with coma as decimal separator, but while reading it expects a dot. So I guess it was trying sound volume over 1 (the part after the coma), then clicking "Options" made it 1 somehow, then I broke it again by going to 0,5 or whatever.

The work-around was also easy. In RunHammerwatch,
Code: [Select]
LANG=C mono "$DIR/Hammerwatch.exe" $*
This is an archaic Mono 2.10.5, so maybe it's a Mono bug, not Hammerwatch itself - you test :)

Myran

  • Developer
  • Posts: 183
    • View Profile
Re: [Linux] config resetting each startup
« Reply #1 on: September 03, 2013, 10:06:45 PM »
That is very interesting, I use a Swedish locale so generally the code works well when using non-english locales, but when saving the config.xml I use the .net xml api in which I cannot choose how it's supposed to save it. It works for me when using .NET on my Windows machine and when using Mono (both 2.10 and 3.2) on my Mac, but the Linux machine I use is actually set to american so I never tried it properly there.
Thank you for this info, I'll try to force the correct format when saving the config as well.