diff --git a/core/CHalfLife2.cpp b/core/CHalfLife2.cpp index 2a724b3f..ca07c45f 100644 --- a/core/CHalfLife2.cpp +++ b/core/CHalfLife2.cpp @@ -73,7 +73,18 @@ SendProp *UTIL_FindInSendTable(SendTable *pTable, const char *name) return NULL; } -SendProp *CHalfLife2::FindInSendTable(const char *classname, const char *offset) +ServerClass *CHalfLife2::FindServerClass(const char *classname) +{ + DataTableInfo *pInfo = _FindServerClass(classname); + if (!pInfo) + { + return NULL; + } + + return pInfo->sc; +} + +DataTableInfo *CHalfLife2::_FindServerClass(const char *classname) { DataTableInfo *pInfo = NULL; @@ -98,6 +109,18 @@ SendProp *CHalfLife2::FindInSendTable(const char *classname, const char *offset) } } + return pInfo; +} + +SendProp *CHalfLife2::FindInSendTable(const char *classname, const char *offset) +{ + DataTableInfo *pInfo = _FindServerClass(classname); + + if (!pInfo) + { + return NULL; + } + SendProp *pProp; if (!sm_trie_retrieve(pInfo->lookup, offset, (void **)&pProp)) { diff --git a/core/CHalfLife2.h b/core/CHalfLife2.h index f540d670..3f03ff99 100644 --- a/core/CHalfLife2.h +++ b/core/CHalfLife2.h @@ -39,7 +39,10 @@ public: void OnSourceModAllShutdown();*/ public: SendProp *FindInSendTable(const char *classname, const char *offset); -public: + ServerClass *FindServerClass(const char *classname); +private: + DataTableInfo *_FindServerClass(const char *classname); +private: Trie *m_pClasses; List m_Tables; };