Skip to content

Commit

Permalink
Update CConVarBaseData::Cast methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Wend4r committed Nov 26, 2024
1 parent 2a8257f commit d50a227
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions public/icvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,21 +187,17 @@ class CConVarBaseData
template<typename T>
inline const CConVarData<T>* Cast() const
{
if (this->m_eVarType == TranslateConVarType<T>())
{
return reinterpret_cast<const CConVarData<T>*>(this);
}
return nullptr;
Assert(this->m_eVarType == TranslateConVarType<T>());

return reinterpret_cast<const CConVarData<T>*>(this);
}

template<typename T>
inline CConVarData<T>* Cast()
{
if (this->m_eVarType == TranslateConVarType<T>())
{
return reinterpret_cast<CConVarData<T>*>(this);
}
return nullptr;
Assert(this->m_eVarType == TranslateConVarType<T>());

return reinterpret_cast<const CConVarData<T>*>(this);
}

CConVarBaseData() :
Expand Down

0 comments on commit d50a227

Please sign in to comment.