From e56e35f94e5cc0380e8b84b6b97e9c69f6d02608 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 5 Aug 2024 18:12:18 +0800 Subject: [PATCH] [saco] Implement/match `CPlayerPed::SetTargetRotation(...)` --- saco/game/playerped.cpp | 11 +++++++++++ saco/game/playerped.h | 1 + 2 files changed, 12 insertions(+) diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index 48eeee9..7bb2f80 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -279,6 +279,17 @@ float CPlayerPed::GetTargetRotation() return fZAngle; } +//----------------------------------------------------------- + +void CPlayerPed::SetTargetRotation(float fRotation) +{ + if(!m_pPed) return; + if(!GamePool_Ped_GetAt(m_dwGTAId)) return; + + m_pPed->fRotation2 = DegToRad(fRotation); + m_pPed->fRotation1 = DegToRad(fRotation); +} + //----------------------------------------------------------- void CPlayerPed::GiveWeapon(int iWeaponID, int iAmmo) diff --git a/saco/game/playerped.h b/saco/game/playerped.h index fcb1139..30eb028 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -42,6 +42,7 @@ public: WORD GetAmmo(); float GetTargetRotation(); + void SetTargetRotation(float fRotation); void GiveWeapon(int iWeaponID, int iAmmo); void SetArmedWeapon(int iWeaponType, bool bUnk); WEAPON_SLOT_TYPE * GetCurrentWeaponSlot();