From 2037ffa1f22cb19444998e090ecc954e6b5aea26 Mon Sep 17 00:00:00 2001 From: IcePixelx <41352111+PixieCore@users.noreply.github.com> Date: Sat, 29 Jan 2022 18:00:29 +0100 Subject: [PATCH] convar creation suggestion. --- r5dev/tier0/IConVar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/r5dev/tier0/IConVar.cpp b/r5dev/tier0/IConVar.cpp index 75df4a42..3926eb20 100644 --- a/r5dev/tier0/IConVar.cpp +++ b/r5dev/tier0/IConVar.cpp @@ -16,6 +16,7 @@ //----------------------------------------------------------------------------- ConVar::ConVar(const char* pszName, const char* pszDefaultValue, int nFlags, const char* pszHelpString, bool bMin, float fMin, bool bMax, float fMax, void* pCallback, void* unk) { + // Here we should make a proper constructor so we don't need casts etc. Maybe make a custom class/struct or use existing one, and then use register function at bottom. ConVar* allocatedConvar = reinterpret_cast(MemAlloc_Wrapper(0xA0)); // Allocate new memory with StdMemAlloc else we crash. memset(allocatedConvar, 0, 0xA0); // Set all to null. std::uintptr_t cvarPtr = reinterpret_cast(allocatedConvar); // To ptr.