From 793b1593a60edb9453bee2fcc9081ab5d358a7ee Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sun, 30 Aug 2026 13:25:34 +0700 Subject: [PATCH] [saco] Implement/match `CWeapon__FireSniper_Hook` --- saco/game/hooks.cpp | 21 ++++++++++++++++++++- saco/game/playerped.h | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/saco/game/hooks.cpp b/saco/game/hooks.cpp index 6276e64..0c88adc 100644 --- a/saco/game/hooks.cpp +++ b/saco/game/hooks.cpp @@ -1837,9 +1837,28 @@ NUDE CWorld__ProcessLineOfSight_Hook() //----------------------------------------------------------- +ENTITY_TYPE* pSniperFiringEntity = 0; + NUDE CWeapon__FireSniper_Hook() { - // TODO: CWeapon__FireSniper_Hook + _asm mov eax, [esp+0x4] + _asm mov pSniperFiringEntity, eax + _asm pushad + + if(pSniperFiringEntity != (ENTITY_TYPE*)GamePool_FindPlayerPed()) + { + __asm + { + popad + retn 0xC + } + } + + if(pGame && pGame->FindPlayerPed()) + pGame->FindPlayerPed()->FUNC_100AFA70(); + + _asm popad + _asm ret 0xC } //----------------------------------------------------------- diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 315a970..ec0f7f8 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -141,6 +141,8 @@ public: VECTOR* GetBonePosition(int iBone, VECTOR *vecPos); VECTOR* GetTransformedBonePosition(int iBone, VECTOR *vecOffset); + BOOL FUNC_100AFA70(); // .text:100AFA70 + int m_iCellPhoneEnabled; int field_4C[10]; struc_97 field_74[10];