aboutsummaryrefslogtreecommitdiff
path: root/src/internal/convarproxy.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/convarproxy.h')
-rw-r--r--src/internal/convarproxy.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/internal/convarproxy.h b/src/internal/convarproxy.h
index 08aea5a..3291bd8 100644
--- a/src/internal/convarproxy.h
+++ b/src/internal/convarproxy.h
@@ -62,7 +62,8 @@ public:
}
const char* GetString() const {
- assert(this->ptr);
+ if (!this->ptr)
+ return this->pszDefaultValue;
return this->ptr->m_Value.m_pszString;
}
@@ -72,13 +73,15 @@ public:
}
int GetInt() const {
- assert(this->ptr);
+ if (!this->ptr)
+ return atoi(this->pszDefaultValue);
return this->ptr->m_Value.m_nValue;
}
float GetFloat() const {
- assert(this->ptr);
+ if (!this->ptr)
+ return atof(this->pszDefaultValue);
return this->ptr->m_Value.m_fValue;
}