Bug - Fixed The thing where oilPeakProgress sometimes gets retardedly big values

gulaschkanone

New member
I think i found out what the problem is. It looks like this thing happens on systems with languages that use something as decimal separator that isn't a point, like for example german, where comma is used instead. What happens is that String.format( "%.2f", whatever) (in QuestManager.java) outputs something like the string "247,26", which is then written to the property, and next time it is read back in, it's parsed to a float in StringUtilities.parseFloat, which discards the comma, making it "24726", this blowing the number up by 2 orders of magnitude for each turn spent in oil peak. Stackoverflow suggests the following fix:
Please be carefull as String.format depend on your current Local configuration, you may not get a dot as a separator. Prefer using String.format(java.util.Locale.US,"%.2f", floatValue);
 
Top