diff --git a/src/Basehook.cpp b/src/Basehook.cpp index d5b7628..30638be 100644 --- a/src/Basehook.cpp +++ b/src/Basehook.cpp @@ -41,8 +41,6 @@ CGlobalVarsBase* globalvars = nullptr; CRC32_ProcessBufferFn CRC32_ProcessBuffer = NULL; -NetVars netvars; - std::unique_ptr sdl_hook; std::unique_ptr panel_hook; std::unique_ptr clientdll_hook; diff --git a/src/Basehook.h b/src/Basehook.h index 1a8aa8a..6366c06 100644 --- a/src/Basehook.h +++ b/src/Basehook.h @@ -9,6 +9,4 @@ #include "Utilities/Linker.h" #include "Utilities/FindPattern.h" #include "Utilities/Interfaces.h" -#include "Utilities/NetVars.h" - -extern NetVars netvars; \ No newline at end of file +#include "Utilities/NetVars.h" \ No newline at end of file diff --git a/src/Utilities/NetVars.h b/src/Utilities/NetVars.h index 1c426f0..9862154 100644 --- a/src/Utilities/NetVars.h +++ b/src/Utilities/NetVars.h @@ -2,7 +2,7 @@ class NetVars { private: - inline uintptr_t FindOffset(RecvTable* recv_table, const char* property_name, RecvProp** property_ptr = nullptr) { + static uintptr_t FindOffset(RecvTable* recv_table, const char* property_name, RecvProp** property_ptr = nullptr) { for (int i = 0; i < recv_table->m_nProps; i++) { RecvProp& recv_prop = recv_table->m_pProps[i]; @@ -17,7 +17,7 @@ class NetVars { continue; } - if (uintptr_t offset = this->FindOffset(recv_prop.m_pDataTable, property_name)) { + if (uintptr_t offset = FindOffset(recv_prop.m_pDataTable, property_name)) { if (property_ptr) *property_ptr = &recv_table->m_pProps[i]; @@ -28,10 +28,10 @@ class NetVars { return 0; } public: - uintptr_t GetOffset(const char* class_name, const char* property_name, RecvProp** property_ptr = nullptr) { + static uintptr_t GetOffset(const char* class_name, const char* property_name, RecvProp** property_ptr = nullptr) { for (ClientClass* class_ptr = clientdll->GetAllClasses(); class_ptr; class_ptr = class_ptr->m_pNext) { if (strcmp(class_ptr->m_pNetworkName, class_name) == 0) { - return this->FindOffset(class_ptr->m_pRecvTable, property_name, property_ptr); + return FindOffset(class_ptr->m_pRecvTable, property_name, property_ptr); } }