diff --git a/hecl/include/hecl/CVar.hpp b/hecl/include/hecl/CVar.hpp index 65d30a7f5..384fe2164 100644 --- a/hecl/include/hecl/CVar.hpp +++ b/hecl/include/hecl/CVar.hpp @@ -70,8 +70,8 @@ public: float toFloat(bool* isValid = nullptr) const; bool toBoolean(bool* isValid = nullptr) const; int toInteger(bool* isValid = nullptr) const; - const std::wstring toWideLiteral(bool* isValid = nullptr) const; - const std::string toLiteral(bool* isValid = nullptr) const; + std::wstring toWideLiteral(bool* isValid = nullptr) const; + std::string toLiteral(bool* isValid = nullptr) const; bool fromVec4f(const atVec4f& val); bool fromFloat(float val); diff --git a/hecl/lib/CVar.cpp b/hecl/lib/CVar.cpp index ae1d25d6e..9d2bfc81c 100644 --- a/hecl/lib/CVar.cpp +++ b/hecl/lib/CVar.cpp @@ -191,23 +191,25 @@ int CVar::toInteger(bool* isValid) const { return strtol(m_value.c_str(), nullptr, 0); } -const std::string CVar::toLiteral(bool* isValid) const { +std::string CVar::toLiteral(bool* isValid) const { if (m_type != EType::Literal && (com_developer && com_developer->toBoolean())) { if (isValid != nullptr) *isValid = false; - } else if (isValid != nullptr) + } else if (isValid != nullptr) { *isValid = true; + } // Even if it's not a literal, it's still safe to return return m_value; } -const std::wstring CVar::toWideLiteral(bool* isValid) const { +std::wstring CVar::toWideLiteral(bool* isValid) const { if (m_type != EType::Literal && (com_developer && com_developer->toBoolean())) { if (isValid != nullptr) *isValid = false; - } else if (isValid != nullptr) + } else if (isValid != nullptr) { *isValid = true; + } // Even if it's not a literal, it's still safe to return return hecl::UTF8ToWide(m_value);