From f2a6a09e3c6807843d9e1f0ebb4cd5081dbe9ac0 Mon Sep 17 00:00:00 2001 From: darkrose Date: Fri, 18 Dec 2015 18:18:34 +1000 Subject: [PATCH] heh, oops --- src/settings.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/settings.h b/src/settings.h index 64b9631..5d8d1b8 100644 --- a/src/settings.h +++ b/src/settings.h @@ -676,26 +676,30 @@ public: virtual bool parseConfigLine(const std::string &line) { - JMutexAutoLock lock(m_mutex); + std::string name; + std::string value; + { + JMutexAutoLock lock(m_mutex); - std::string trimmedline = trim(line); + std::string trimmedline = trim(line); - // Ignore comments - if (trimmedline[0] == '#') - return true; + // Ignore comments + if (trimmedline[0] == '#') + return true; - Strfnd sf(trim(line)); + Strfnd sf(trimmedline); - std::string name = sf.next("="); - name = trim(name); + name = sf.next("="); + name = trim(name); - if (name == "") - return true; + if (name == "") + return true; - std::string value = sf.next("\n"); - value = trim(value); + value = sf.next("\n"); + value = trim(value); - m_settings[name] = value; + m_settings[name] = value; + } if (name == "game_mode") setGameDefaults(value);