From 771c1b00c80676b707fbde6f7afc08b6a2744088 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:11:01 +0800 Subject: [PATCH] [saco] Implement/match `CPlayerPed::GetAimZ()` --- saco/game/playerped.cpp | 18 ++++++++++++++++++ saco/game/playerped.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index 3a87a9b..766d191 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -882,3 +882,21 @@ BOOL CPlayerPed::HasGoggles() } //----------------------------------------------------------- + +float CPlayerPed::GetAimZ() +{ + if(m_pPed) { + DWORD dwPlayerInfo = m_pPed->dwPlayerInfoOffset; + + float fAimZ; + _asm mov eax, dwPlayerInfo + _asm mov ebx, [eax+84] + _asm mov fAimZ, ebx + + return fAimZ; + } + return 0.0f; +} + +//----------------------------------------------------------- + diff --git a/saco/game/playerped.h b/saco/game/playerped.h index c1a19db..9656e2f 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -87,6 +87,8 @@ public: //char _gap0[813]; //char _gap0[741]; int field_48; + float GetAimZ(); + int field_4C[10]; struc_97 field_74[10]; int field_27C[10];