aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/convar.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-11 14:11:37 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-11 14:11:37 +0100
commit862a115b08017e02b45a786e59feb436d1de278f (patch)
treed45b4920da15a12f1395b4c05cf4babec84e632e /NorthstarDedicatedTest/convar.cpp
parent2dba51a6a281573ea40cc52c80d10155387d4720 (diff)
downloadNorthstarLauncher-862a115b08017e02b45a786e59feb436d1de278f.tar.gz
NorthstarLauncher-862a115b08017e02b45a786e59feb436d1de278f.zip
move hoststate to its own file and add host_init hooks
Diffstat (limited to 'NorthstarDedicatedTest/convar.cpp')
-rw-r--r--NorthstarDedicatedTest/convar.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/NorthstarDedicatedTest/convar.cpp b/NorthstarDedicatedTest/convar.cpp
index c8e76e47..3ae02463 100644
--- a/NorthstarDedicatedTest/convar.cpp
+++ b/NorthstarDedicatedTest/convar.cpp
@@ -26,9 +26,6 @@ ConVarMallocType conVarMalloc;
void* g_pConVar_Vtable = nullptr;
void* g_pIConVar_Vtable = nullptr;
-typedef bool (*CvarIsFlagSetType)(ConVar* self, int flags);
-CvarIsFlagSetType CvarIsFlagSet;
-
//-----------------------------------------------------------------------------
// Purpose: ConVar interface initialization
//-----------------------------------------------------------------------------
@@ -42,9 +39,6 @@ ON_DLL_LOAD("engine.dll", ConVar, [](HMODULE baseAddress)
g_pCVarInterface = new SourceInterface<CCvar>("vstdlib.dll", "VEngineCvar007");
g_pCVar = *g_pCVarInterface;
-
- HookEnabler hook;
- ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x417FA0, &ConVar::IsFlagSet, reinterpret_cast<LPVOID*>(&CvarIsFlagSet));
})
//-----------------------------------------------------------------------------
@@ -475,16 +469,12 @@ bool ConVar::IsCommand(void) const
//-----------------------------------------------------------------------------
// Purpose: Test each ConVar query before setting the value.
-// Input : *pConVar - nFlags
+// Input : nFlags
// Output : False if change is permitted, true if not.
//-----------------------------------------------------------------------------
-bool ConVar::IsFlagSet(ConVar* pConVar, int nFlags)
+bool ConVar::IsFlagSet(int nFlags) const
{
- // unrestrict FCVAR_DEVELOPMENTONLY and FCVAR_HIDDEN
- if (pConVar && (nFlags == FCVAR_DEVELOPMENTONLY || nFlags == FCVAR_HIDDEN))
- return false;
-
- return CvarIsFlagSet(pConVar, nFlags);
+ return m_ConCommandBase.IsFlagSet(nFlags);
}
//-----------------------------------------------------------------------------