From 1b62a8d3c4c10229012fd026f1bbefb6fdd5fdda Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sat, 2 Nov 2024 22:58:45 +0800 Subject: [PATCH] [saco] Implement/match `CPlayerPed::DestroyFollowPedTask()` --- saco/game/common.h | 3 +++ saco/game/playerped.cpp | 20 +++++++++++++++++++- saco/game/playerped.h | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/saco/game/common.h b/saco/game/common.h index af4aba1..a1770c5 100644 --- a/saco/game/common.h +++ b/saco/game/common.h @@ -89,6 +89,9 @@ typedef struct _PED_TASKS_TYPE // Extended Tasks DWORD * pdwFighting; + char _gap1C[16]; + + DWORD * pdwIK; } PED_TASKS_TYPE; //----------------------------------------------------------- diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index 57bb5bc..6e81aa1 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -1265,7 +1265,7 @@ void CPlayerPed::ApplyCommandTask(char *szTaskName, int p1, int p2, int p3, DWORD dwPed = (DWORD)m_pPed; if(!dwPed) return; - _asm push p9 + _asm push p9 _asm push p8 _asm push p7 _asm push p6 @@ -1283,6 +1283,24 @@ void CPlayerPed::ApplyCommandTask(char *szTaskName, int p1, int p2, int p3, //----------------------------------------------------------- +DWORD dwExt4; + +void CPlayerPed::DestroyFollowPedTask() +{ + if(!m_pPed) return; + dwExt4 = (DWORD)m_pPed->Tasks->pdwIK; + if(!dwExt4) return; + + _asm mov ecx, dwExt4 + _asm mov edx, 0x639330 + _asm push 1 + _asm call edx + + m_pPed->Tasks->pdwIK = 0; +} + +//----------------------------------------------------------- + void CPlayerPed::ProcessVehicleHorn() { if(!m_pPed) return; diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 0211c71..638b0e9 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -113,6 +113,8 @@ public: void ApplyCommandTask(char *szTaskName, int p1, int p2, int p3, VECTOR *p4, int p5, float p6, int p7, int p8, int p9); + void DestroyFollowPedTask(); + BOOL IsJumping(); BOOL IsFighting(); BOOL IsFalling();