From 51ace160743a7b610d7afbf509e0054a12ae586a Mon Sep 17 00:00:00 2001 From: PixieCore <41352111+PixieCore@users.noreply.github.com> Date: Sun, 1 May 2022 20:57:08 +0200 Subject: [PATCH] Fix CBaseClientState pointer vars. --- r5dev/engine/baseclientstate.cpp | 8 ++++---- r5dev/engine/baseclientstate.h | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/r5dev/engine/baseclientstate.cpp b/r5dev/engine/baseclientstate.cpp index 34c89ced..fa4abc83 100644 --- a/r5dev/engine/baseclientstate.cpp +++ b/r5dev/engine/baseclientstate.cpp @@ -15,7 +15,7 @@ //------------------------------------------------------------------------------ bool CBaseClientState::IsPaused() { - return *m_bPaused; + return **m_bPaused; } //------------------------------------------------------------------------------ @@ -26,7 +26,7 @@ float CBaseClientState::GetClientTime() { if (*cl_time_use_host_tickcount) { - return (float)(int)*host_tickcount * (float)*client_debugdraw_int_unk; + return (float)(int)**host_tickcount * (float)*client_debugdraw_int_unk; } else { @@ -39,7 +39,7 @@ float CBaseClientState::GetClientTime() //------------------------------------------------------------------------------ int CBaseClientState::GetClientTickCount() const { - return *host_tickcount; + return **host_tickcount; } //------------------------------------------------------------------------------ @@ -47,7 +47,7 @@ int CBaseClientState::GetClientTickCount() const //------------------------------------------------------------------------------ void CBaseClientState::SetClientTickCount(int tick) { - *host_tickcount = tick; + **host_tickcount = tick; } CBaseClientState* g_pBaseClientState = new CBaseClientState(); diff --git a/r5dev/engine/baseclientstate.h b/r5dev/engine/baseclientstate.h index 6d63f8f5..10ca433e 100644 --- a/r5dev/engine/baseclientstate.h +++ b/r5dev/engine/baseclientstate.h @@ -8,8 +8,8 @@ inline int* cl_host_tickcount = nullptr; class CBaseClientState { public: - bool* m_bPaused = cl_m_bPaused; // pauzes the client side simulation in apex. - int* host_tickcount = cl_host_tickcount; // client simulation tick count. + bool** m_bPaused = &cl_m_bPaused; // pauzes the client side simulation in apex. + int** host_tickcount = &cl_host_tickcount; // client simulation tick count. bool IsPaused(); float GetClientTime(); @@ -61,6 +61,8 @@ class HClientState : public IDetour .FindPatternSelf("80 3D ? ? ? 01 ?", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).RCast(); cl_host_tickcount = localRef.Offset(0xC0) .FindPatternSelf("66 0F 6E", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x4, 0x8).RCast(); + + bool test = g_pBaseClientState->IsPaused(); #endif } virtual void GetCon(void) const { }