From f6708ef1264c60b21e90f9c9d7e8fe280433daff Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sat, 5 Sep 2026 10:32:26 +0700 Subject: [PATCH] [saco] Match `CUnkClass10::GetField80`, the third accessor COMDAT; its inlined call site is inside `FUNC_10002FA0` --- saco/game/playerped.h | 1 + saco/net/localplayer.cpp | 44 ++++++++++++++++++++++++++++++++++++++++ saco/net/localplayer.h | 1 + saco/unkclass10.h | 3 +++ 4 files changed, 49 insertions(+) diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 73abdee..693e6bb 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -147,6 +147,7 @@ public: void FUNC_100AC410(DWORD dwGtaId, int a2); // .text:100AC410 void FUNC_100ADFB0(int iLevel); // .text:100ADFB0 int FUNC_100ADC90(); // .text:100ADC90 + void FUNC_100ADFD0(char *szName, int a2, int a3, int a4, VECTOR *pvecPos, int a6, float a7, int a8, int a9, int a10); // .text:100ADFD0 void FUNC_100ABF10(float fAngle); // .text:100ABF10 diff --git a/saco/net/localplayer.cpp b/saco/net/localplayer.cpp index a213908..b8dffea 100644 --- a/saco/net/localplayer.cpp +++ b/saco/net/localplayer.cpp @@ -2,11 +2,13 @@ #include "../main.h" #include "../game/util.h" #include "../game/keystuff.h" +#include "../game/aimstuff.h" extern CGame *pGame; extern CNetGame *pNetGame; extern CCmdWindow *pCmdWindow; extern CUnkClass3 *pUnkClass3; +extern CUnkClass10 *pUnkClass10; extern CDXUTDialog *pClassSelectDialog; DWORD dword_100FE0A4 = -1; @@ -739,3 +741,45 @@ void CLocalPlayer::FUNC_10006100() SelectNextClass(); } } + +//---------------------------------------------------- + +// keeps the FollowPedSA marker on the aim point, refreshed five times a second +void CLocalPlayer::FUNC_10002FA0() +{ + if(m_pPlayerPed && (!pGame || pGame->m_bHeadMove) && !m_pPlayerPed->FUNC_100ADC90() + && (!pUnkClass10 || !pUnkClass10->GetField80())) + { + MATRIX4X4 mat; + + m_pPlayerPed->GetMatrix(&mat); + + DWORD dwTick = GetTickCount(); + + if(dwTick - field_137 > 1000) + { + CAMERA_AIM *pAim = GameGetInternalAim(); + + float fX = pAim->f1x * 20.0f + mat.pos.X; + float fY = pAim->f1y * 20.0f + mat.pos.Y; + float fZ = pAim->f1z * 20.0f + mat.pos.Z; + + field_137 = dwTick; + *(float *)&field_12B[0] = fX - mat.pos.X; + *(float *)&field_12B[4] = fY - mat.pos.Y; + *(float *)&field_12B[8] = fZ - mat.pos.Z; + } + + if(dwTick - field_13B > 200) + { + VECTOR vecTarget; + + vecTarget.X = mat.pos.X + *(float *)&field_12B[0]; + vecTarget.Y = mat.pos.Y + *(float *)&field_12B[4]; + vecTarget.Z = mat.pos.Z + *(float *)&field_12B[8]; + + m_pPlayerPed->FUNC_100ADFD0("FollowPedSA", 0, 2000, -1, &vecTarget, 0, 0.1f, 500, 3, 0); + field_13B = dwTick; + } + } +} diff --git a/saco/net/localplayer.h b/saco/net/localplayer.h index 2f20231..a4ba7e9 100644 --- a/saco/net/localplayer.h +++ b/saco/net/localplayer.h @@ -151,6 +151,7 @@ public: void FUNC_10004080(); // .text:10004080 void FUNC_10004230(WORD a1); // .text:10004230 void FUNC_10004280(PLAYERID playerId); // .text:10004280 + void FUNC_10002FA0(); // .text:10002FA0 void FUNC_10006100(); // .text:10006100 void SendDeath(); // .text:10005810 void SetInteriorId(BYTE byteInteriorId); // .text:10005970 diff --git a/saco/unkclass10.h b/saco/unkclass10.h index 8aa5596..1db4220 100644 --- a/saco/unkclass10.h +++ b/saco/unkclass10.h @@ -29,6 +29,9 @@ private: int field_113; public: + + int GetField80() { return field_80; }; // .text:10002E70, out of line copy + CUnkClass10(IDirect3DDevice9 *pD3DDevice); float FUNC_10071C20(D3DXVECTOR3 *pPos, D3DXVECTOR2 *pOut);