1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 22:45:34 +00:00

Merge pull request #2467 from Capostrophic/stream

[Regression] Editor: Avoid locale-related settings parsing issues
This commit is contained in:
Alexei Dobrohotov 2019-08-01 20:39:06 +03:00 committed by GitHub
commit 3f2b63122d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@
#include <stdexcept>
#include <algorithm>
#include <sstream>
#include "intsetting.hpp"
#include "doublesetting.hpp"
@ -415,7 +416,9 @@ CSMPrefs::DoubleSetting& CSMPrefs::State::declareDouble (const std::string& key,
if (mCurrentCategory==mCategories.end())
throw std::logic_error ("no category for setting");
setDefault(key, std::to_string(default_));
std::ostringstream stream;
stream << default_;
setDefault(key, stream.str());
default_ = mSettings.getFloat (key, mCurrentCategory->second.getKey());