From 27b31e604d8ec98a12682b3f6e3987e852b2e10d Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:17:46 +0800 Subject: [PATCH] [saco] Implement/match `CPlayerPed::IsPerformingAnimation(...)` --- saco/game/playerped.cpp | 10 ++++++++++ saco/game/playerped.h | 1 + saco/game/scripting.h | 1 + 3 files changed, 12 insertions(+) diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index 721d1e1..e05ac90 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -1118,6 +1118,16 @@ void CPlayerPed::ApplyAnimation( char *szAnimName, char *szAnimFile, float fT, //----------------------------------------------------------- +BOOL CPlayerPed::IsPerformingAnimation(char *szAnimName) +{ + if(m_pPed && ScriptCommand(&is_actor_performing_anim,m_dwGTAId,szAnimName)) { + return TRUE; + } + return FALSE; +} + +//----------------------------------------------------------- + float CPlayerPed::GetAimZ() { if(m_pPed) { diff --git a/saco/game/playerped.h b/saco/game/playerped.h index f0634e3..b2129c8 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -95,6 +95,7 @@ public: void ApplyAnimation(char *szAnimName, char *szAnimFile, float fT, int opt1, int opt2, int opt3, int opt4, int iUnk); + BOOL IsPerformingAnimation(char *szAnimName); CPlayerPed(); diff --git a/saco/game/scripting.h b/saco/game/scripting.h index c3b08e1..6a18937 100644 --- a/saco/game/scripting.h +++ b/saco/game/scripting.h @@ -100,6 +100,7 @@ const SCRIPT_COMMAND request_animation = { 0x04ED, "s" }; const SCRIPT_COMMAND is_animation_loaded = { 0x04EE, "s" }; const SCRIPT_COMMAND release_animation = { 0x04EF, "s" }; const SCRIPT_COMMAND apply_animation = { 0x0812, "issfiiiii" }; // actor,animation,library,floatunk,bool,bool,bool,bool,int +const SCRIPT_COMMAND is_actor_performing_anim = { 0x0611, "is" }; const SCRIPT_COMMAND set_actor_weapon_droppable = { 0x087e, "ii" }; const SCRIPT_COMMAND set_actor_money = { 0x03fe, "ii" };