aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/convar.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-18 03:13:52 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-18 03:13:52 +0000
commite512279b5cb47fca0107fb5e80a3d0a468bb5e6f (patch)
treea4595885fe1d86affe7b2d668cbe743f9a5b572c /NorthstarDedicatedTest/convar.cpp
parentcd18553bbc302f264edf35eed1daab07a2512513 (diff)
downloadNorthstarLauncher-e512279b5cb47fca0107fb5e80a3d0a468bb5e6f.tar.gz
NorthstarLauncher-e512279b5cb47fca0107fb5e80a3d0a468bb5e6f.zip
make FCVAR_CLIENTCMD_CAN_EXECUTE checks not rely on concommand dispatch hooks that may be inconsistent across dlls
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));