From 0fba86e33f212fedb84a622aecac2add0ab3d409 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:16:42 +0800 Subject: [PATCH] [saco] Implement/match `CPlayerPed::GetGtaContactEntity()` --- saco/game/common.h | 10 +++++++++- saco/game/playerped.cpp | 8 ++++++++ saco/game/playerped.h | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/saco/game/common.h b/saco/game/common.h index 60427f9..db41a12 100644 --- a/saco/game/common.h +++ b/saco/game/common.h @@ -140,7 +140,15 @@ typedef struct _PED_TYPE float fRotation1; // 1368-1372 float fRotation2; // 1372-1376 - char _gap560[44]; + char _gap560[8]; + + DWORD pContactVehicle; // 1384 - 1388 + + char _gap56C[24]; + + DWORD pContactEntity; // 1412 - 1416 + + char _gap588[4]; DWORD pVehicle; // 1420-1424 diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index e5f9702..4fcf734 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -913,3 +913,11 @@ void CPlayerPed::SetAimZ(float fAimZ) } //----------------------------------------------------------- + +ENTITY_TYPE* CPlayerPed::GetGtaContactEntity() +{ + return (ENTITY_TYPE*)m_pPed->pContactEntity; +} + +//----------------------------------------------------------- + diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 7ece363..e3ea70a 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -68,6 +68,7 @@ public: BOOL IsAPassenger(); VEHICLE_TYPE * GetGtaVehicle(); + ENTITY_TYPE * GetGtaContactEntity(); float GetDistanceFromVehicle(CVehicle *pVehicle);