From 7ebeab2055601a1d316cd35541c8fad46c1ca234 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 20 Aug 2024 23:05:14 +0800 Subject: [PATCH] [saco] Implement/match `CVehicle::IsDriverLocalPlayer()` --- saco/game/vehicle.cpp | 12 ++++++++++++ saco/game/vehicle.h | 1 + 2 files changed, 13 insertions(+) diff --git a/saco/game/vehicle.cpp b/saco/game/vehicle.cpp index 01b1236..86fa562 100644 --- a/saco/game/vehicle.cpp +++ b/saco/game/vehicle.cpp @@ -127,3 +127,15 @@ BOOL CVehicle::IsWrecked() //----------------------------------------------------------- +BOOL CVehicle::IsDriverLocalPlayer() +{ + if(m_pVehicle) { + if((PED_TYPE *)m_pVehicle->pDriver == GamePool_FindPlayerPed()) { + return TRUE; + } + } + return FALSE; +} + +//----------------------------------------------------------- + diff --git a/saco/game/vehicle.h b/saco/game/vehicle.h index 40e6f1b..8a3d4f6 100644 --- a/saco/game/vehicle.h +++ b/saco/game/vehicle.h @@ -27,6 +27,7 @@ public: BOOL HasSunk(); BOOL IsWrecked(); + BOOL IsDriverLocalPlayer(); BOOL HasADriver(); void SetEngineState(BOOL bState);