From fd05a353418e1be8f4d5194fd2222de7f3955241 Mon Sep 17 00:00:00 2001 From: Treeston Date: Mon, 24 Aug 2020 16:38:39 +0200 Subject: Revert "[3.3.5] Core/ChatCommands: C++17 cleanup (if constexpr + std::string_view)" This reverts commit 11c4a60fbe9d471618e0579f588706746ff3e439. --- src/common/Configuration/Config.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/common/Configuration/Config.cpp') diff --git a/src/common/Configuration/Config.cpp b/src/common/Configuration/Config.cpp index d9af7ae1187..fa0e546ccc3 100644 --- a/src/common/Configuration/Config.cpp +++ b/src/common/Configuration/Config.cpp @@ -137,15 +137,7 @@ bool ConfigMgr::GetBoolDefault(std::string const& name, bool def, bool quiet) co { std::string val = GetValueDefault(name, std::string(def ? "1" : "0"), quiet); val.erase(std::remove(val.begin(), val.end(), '"'), val.end()); - Optional boolVal = StringToBool(val); - if (boolVal) - return *boolVal; - else - { - TC_LOG_ERROR("server.loading", "Bad value defined for name %s in config file %s, going to use '%s' instead", - name.c_str(), _filename.c_str(), def ? "true" : "false"); - return def; - } + return StringToBool(val); } int ConfigMgr::GetIntDefault(std::string const& name, int def, bool quiet) const -- cgit v1.2.3