aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/convar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDedicatedTest/convar.cpp')
-rw-r--r--NorthstarDedicatedTest/convar.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/convar.cpp b/NorthstarDedicatedTest/convar.cpp
index de460662..344f16c6 100644
--- a/NorthstarDedicatedTest/convar.cpp
+++ b/NorthstarDedicatedTest/convar.cpp
@@ -2,10 +2,12 @@
#include "convar.h"
#include "hookutils.h"
#include "gameutils.h"
+#include "sourceinterface.h"
#include <set>
// should this be in modmanager?
std::unordered_map<std::string, ConVar*> g_CustomConvars; // this is used in modloading code to determine whether we've registered a mod convar already
+SourceInterface<ICvar>* g_pCvar;
typedef void(*ConVarConstructorType)(ConVar* newVar, const char* name, const char* defaultValue, int flags, const char* helpString);
ConVarConstructorType conVarConstructor;
@@ -37,6 +39,7 @@ bool CvarIsFlagSetHook(ConVar* self, int flags)
void InitialiseConVars(HMODULE baseAddress)
{
conVarConstructor = (ConVarConstructorType)((char*)baseAddress + 0x416200);
+ g_pCvar = new SourceInterface<ICvar>("vstdlib.dll", "VEngineCvar007");
HookEnabler hook;
ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x417FA0, &CvarIsFlagSetHook, reinterpret_cast<LPVOID*>(&CvarIsFlagSet));