From c42c66fa1c781efbdefcac977d2dd1459c057ffe Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Tue, 17 Oct 2023 01:15:50 -0600 Subject: [PATCH] Update hack.hpp - Fix player distance, as it was just 0, 0, 0 *Fixed by grabbing the pCSPlayerPawn from localPlayer and reading vecOrigin from that* --- memory-external/hacks/hack.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 3071531..2567fc2 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -17,9 +17,18 @@ namespace hack { const int localTeam = process->read(localPlayer + updater::offsets::m_iTeamNum); const view_matrix_t view_matrix = process->read(base_client.base + updater::offsets::dwViewMatrix); - const Vector3 localOrigin = process->read(localPlayer + updater::offsets::m_vecOrigin); const uintptr_t entity_list = process->read(base_client.base + updater::offsets::dwEntityList); + const std::uint32_t localPlayerPawn = process->read(localPlayer + updater::offsets::dwPlayerPawn); + if (!localPlayerPawn) + return; + const uintptr_t localList_entry2 = process->read(entity_list + 0x8 * ((localPlayerPawn & 0x7FFF) >> 9) + 16); + const uintptr_t localpCSPlayerPawn = process->read(localList_entry2 + 120 * (localPlayerPawn & 0x1FF)); + if (!localpCSPlayerPawn) + return; + + const Vector3 localOrigin = process->read(localpCSPlayerPawn + updater::offsets::m_vecOrigin); + int playerIndex = 0; uintptr_t list_entry; @@ -156,7 +165,7 @@ namespace hack { /** * I know is not the best way but a simple way to not saturate the screen with a ton of information */ - if (roundedDistance < config::flag_render_distance) + if (roundedDistance > config::flag_render_distance) continue; render::RenderText(