From 1562f2ae2bfb89a3bcf4b00c2da3714904b4a4be Mon Sep 17 00:00:00 2001 From: MisterY52 <11368116+MisterY52@users.noreply.github.com> Date: Mon, 30 May 2022 10:42:02 +0200 Subject: [PATCH] Thirdperson fix --- apex_dma/apex_dma.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/apex_dma/apex_dma.cpp b/apex_dma/apex_dma.cpp index 6ab7361..6f29ff6 100644 --- a/apex_dma/apex_dma.cpp +++ b/apex_dma/apex_dma.cpp @@ -126,16 +126,6 @@ void DoActions() while (g_Base!=0 && c_Base!=0) { std::this_thread::sleep_for(std::chrono::milliseconds(30)); - if(thirdperson && !tmp_thirdperson) - { - apex_mem.Write(g_Base + OFFSET_THIRDPERSON, 1); - tmp_thirdperson = true; - } - else if(!thirdperson && tmp_thirdperson) - { - apex_mem.Write(g_Base + OFFSET_THIRDPERSON, -1); - tmp_thirdperson = false; - } uint64_t LocalPlayer = 0; apex_mem.Read(g_Base + OFFSET_LOCAL_ENT, LocalPlayer); @@ -148,6 +138,26 @@ void DoActions() { continue; } + + if(thirdperson && !tmp_thirdperson) + { + if(!aiming) + { + apex_mem.Write(g_Base + OFFSET_THIRDPERSON, 1); + apex_mem.Write(LPlayer.ptr + OFFSET_THIRDPERSON_SV, 1); + tmp_thirdperson = true; + } + } + else if((!thirdperson && tmp_thirdperson) || aiming) + { + if(tmp_thirdperson) + { + apex_mem.Write(g_Base + OFFSET_THIRDPERSON, -1); + apex_mem.Write(LPlayer.ptr + OFFSET_THIRDPERSON_SV, 0); + tmp_thirdperson = false; + } + } + uint64_t entitylist = g_Base + OFFSET_ENTITYLIST; uint64_t baseent = 0;