mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Correct vtable name
First vtable in the hierarchy of ConVar is the base table.
This commit is contained in:
parent
e50601ed29
commit
b51baee6cd
@ -24,8 +24,8 @@ ConVar* ConVar::Create(const char* pszName, const char* pszDefaultValue, int nFl
|
||||
ConVar* pNewConVar = MemAllocSingleton()->Alloc<ConVar>(sizeof(ConVar)); // Allocate new memory with StdMemAlloc else we crash.
|
||||
memset(pNewConVar, '\0', sizeof(ConVar)); // Set all to null.
|
||||
|
||||
pNewConVar->m_pConCommandBaseVFTable = g_pConVarVFTable.RCast<IConCommandBase*>();
|
||||
pNewConVar->m_pIConVarVFTable = g_pIConVarVFTable.RCast<IConVar*>();
|
||||
pNewConVar->m_pConCommandBaseVFTable = g_pConVarVBTable.RCast<IConCommandBase*>();
|
||||
pNewConVar->m_pIConVarVFTable = g_pConVarVFTable.RCast<IConVar*>();
|
||||
|
||||
v_ConVar_Register(pNewConVar, pszName, pszDefaultValue, nFlags, pszHelpString, bMin, fMin, bMax, fMax, pCallback, pszUsageString);
|
||||
|
||||
|
@ -105,8 +105,8 @@ inline auto v_ConVar_Register = p_ConVar_Register.RCast<void* (*)(ConVar* thispt
|
||||
inline CMemory p_ConVar_PrintDescription;
|
||||
inline auto v_ConVar_PrintDescription = p_ConVar_PrintDescription.RCast<void* (*)(ConCommandBase* pVar)>();
|
||||
|
||||
inline CMemory g_pConVarVBTable;
|
||||
inline CMemory g_pConVarVFTable;
|
||||
inline CMemory g_pIConVarVFTable;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void ConVar_PrintDescription(ConCommandBase* pVar);
|
||||
@ -116,7 +116,7 @@ class VConVar : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
LogConAdr("IConVar::`vftable'", g_pIConVarVFTable.GetPtr());
|
||||
LogConAdr("ConVar::`vbtable'", g_pConVarVBTable.GetPtr());
|
||||
LogConAdr("ConVar::`vftable'", g_pConVarVFTable.GetPtr());
|
||||
LogFunAdr("ConVar::IsFlagSet", p_ConVar_IsFlagSet.GetPtr());
|
||||
LogFunAdr("ConVar::Register", p_ConVar_Register.GetPtr());
|
||||
@ -139,8 +139,8 @@ class VConVar : public IDetour
|
||||
virtual void GetVar(void) const { }
|
||||
virtual void GetCon(void) const
|
||||
{
|
||||
g_pConVarVFTable = g_GameDll.GetVirtualMethodTable(".?AVConVar@@", 0);
|
||||
g_pIConVarVFTable = g_GameDll.GetVirtualMethodTable(".?AVConVar@@", 1);
|
||||
g_pConVarVBTable = g_GameDll.GetVirtualMethodTable(".?AVConVar@@", 0);
|
||||
g_pConVarVFTable = g_GameDll.GetVirtualMethodTable(".?AVConVar@@", 1);
|
||||
}
|
||||
virtual void Attach(void) const;
|
||||
virtual void Detach(void) const;
|
||||
|
@ -536,7 +536,7 @@ bool ConCommand::IsCommand(void) const
|
||||
//-----------------------------------------------------------------------------
|
||||
bool ConCommandBase::IsCommand(void) const
|
||||
{
|
||||
return m_pConCommandBaseVFTable != g_pConVarVFTable.RCast<void*>();
|
||||
return m_pConCommandBaseVFTable != g_pConVarVBTable.RCast<void*>();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user