2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 01:07:43 +00:00

CVar initialization order fix

This commit is contained in:
Jack Andersen
2016-01-03 19:25:00 -10:00
parent a2cf004785
commit 5c1551bf08
5 changed files with 23 additions and 27 deletions

View File

@@ -23,16 +23,16 @@ CVar::CVar(const std::string& name, const std::string &value, const std::string
}
CVar::CVar(const std::string& name, const std::string& value, const std::string& help, CVar::EFlags flags, CVarManager& parent)
: m_mgr(parent)
: m_mgr(parent)
{
// Unlock the cvar for writing if readonly
unlock();
m_name= name;
m_help = help;
m_type = EType::Literal;
m_flags = flags;
m_allowedWrite = false;
m_name = name;
m_help = help;
m_type = EType::Literal;
// Unlock the cvar for writing if readonly
unlock();
fromLiteral(value);
m_defaultValue = m_value;
@@ -46,15 +46,15 @@ CVar::CVar(const std::string& name, const std::string& value, const std::string&
CVar::CVar(const std::string& name, const atVec4f& value, const std::string& help, EFlags flags, CVarManager& parent)
: m_mgr(parent)
{
// Unlock the cvar for writing if readonly
unlock();
m_name= name;
m_help = help;
m_type = EType::Vec4f;
m_flags = flags;
m_allowedWrite = false;
// Unlock the cvar for writing if readonly
unlock();
fromVec4f(value);
m_defaultValue = m_value;
@@ -67,15 +67,15 @@ CVar::CVar(const std::string& name, const atVec4f& value, const std::string& hel
CVar::CVar(const std::string& name, float value, const std::string& help, EFlags flags, CVarManager& parent)
: m_mgr(parent)
{
// Unlock the cvar for writing if readonly
unlock();
m_name= name;
m_help = help;
m_type = EType::Float;
m_flags = flags;
m_allowedWrite = false;
// Unlock the cvar for writing if readonly
unlock();
fromFloat(value);
m_defaultValue = m_value;
@@ -88,15 +88,15 @@ CVar::CVar(const std::string& name, float value, const std::string& help, EFlags
CVar::CVar(const std::string& name, bool value, const std::string& help, CVar::EFlags flags, CVarManager& parent)
: m_mgr(parent)
{
// Unlock the cvar for writing if readonly
unlock();
m_name= name;
m_help = help;
m_type = EType::Boolean;
m_flags = flags;
m_allowedWrite = false;
// Unlock the cvar for writing if readonly
unlock();
fromBoolean(value);
m_defaultValue = m_value;
@@ -109,15 +109,15 @@ CVar::CVar(const std::string& name, bool value, const std::string& help, CVar::E
CVar::CVar(const std::string& name, int value, const std::string& help, CVar::EFlags flags, CVarManager& parent)
: m_mgr(parent)
{
// Unlock the cvar for writing if readonly
unlock();
m_name= name;
m_help = help;
m_type = EType::Integer;
m_flags = flags;
m_allowedWrite = false;
// Unlock the cvar for writing if readonly
unlock();
fromInteger(value);
m_defaultValue = m_value;