[saco] Implement/match FUNC_10015760, the aim sync handler; repeating the sync load per destination keeps the copies in GPRs instead of fld/fst

This commit is contained in:
ricardoofnl
2026-09-05 08:32:11 +07:00
parent 8be02a792c
commit 5f492d0791
4 changed files with 53 additions and 1 deletions
+2 -1
View File
@@ -65,7 +65,8 @@ typedef struct _WEAPON_SLOT_TYPE
{
DWORD dwType;
char _gap4[8];
DWORD field_4;
DWORD field_8;
DWORD dwAmmo;
+1
View File
@@ -112,6 +112,7 @@ void FUNC_100B5D20(); // .text:100B5D20
void FUNC_100B52B0(MATRIX4X4 *pMatrix, float *pQuatOut); // .text:100B52B0
void FUNC_100B5480(float *pQuatOut, float *pQuatFrom, float *pQuatTo, float fT); // .text:100B5480
void FUNC_100B6A80(float *pQuat, MATRIX4X4 *pMatrix); // .text:100B6A80
void __stdcall FUNC_100B6900(VECTOR *pFront, VECTOR *pOut); // .text:100B6900
void FUNC_100B5210(int a1, void *a2); // .text:100B5210, __cdecl: the caller's
// stack cleanup is folded into the next call's argument setup
+49
View File
@@ -36,6 +36,8 @@ typedef char CRemotePlayer_offsets[(
typedef char CNetPlayer_offsets[(offsetof(CNetPlayer, m_PlayerName) == 0x14) ? 1 : -1];
typedef char struc_41_offsets[(offsetof(struc_41, field_30) == 0x30) ? 1 : -1];
typedef char WEAPON_SLOT_offsets[(offsetof(WEAPON_SLOT_TYPE, field_8) == 8 &&
sizeof(WEAPON_SLOT_TYPE) == 28) ? 1 : -1];
typedef char CPlayerPool_offsets[(offsetof(CPlayerPool, field_6) == 6 &&
sizeof(std::string) == 0x1C) ? 1 : -1];
@@ -405,6 +407,53 @@ void CRemotePlayer::FUNC_10017260(BYTE *pSync, int iTime)
//----------------------------------------------------
void CRemotePlayer::FUNC_10015760(BYTE *pAim)
{
if(!m_pPlayerPed) return;
m_pPlayerPed->SetCameraMode(pAim[0]);
CAMERA_AIM aim;
VECTOR vecFront;
VECTOR vecUp;
vecUp.X = 0.0f;
vecUp.Y = 0.0f;
vecUp.Z = 0.0f;
aim.f1x = *(float *)(pAim + 1);
aim.f1y = *(float *)(pAim + 5);
aim.f1z = *(float *)(pAim + 9);
vecFront.X = *(float *)(pAim + 1);
vecFront.Y = *(float *)(pAim + 5);
vecFront.Z = *(float *)(pAim + 9);
FUNC_100B6900(&vecFront, &vecUp);
aim.f2x = vecUp.X;
aim.f2y = vecUp.Y;
aim.f2z = vecUp.Z;
aim.pos1x = *(float *)(pAim + 0xD);
aim.pos1y = *(float *)(pAim + 0x11);
aim.pos1z = *(float *)(pAim + 0x15);
aim.pos2x = *(float *)(pAim + 0xD);
aim.pos2y = *(float *)(pAim + 0x11);
aim.pos2z = *(float *)(pAim + 0x15);
m_pPlayerPed->SetCurrentAim(&aim);
m_pPlayerPed->SetAimZ(*(float *)(pAim + 0x19));
m_pPlayerPed->SetCameraExtZoom((float)(pAim[0x1D] & 0x3F) * 0.015873017f,
(float)pAim[0x1E] * 0.0039215689f);
WEAPON_SLOT_TYPE *pSlot = m_pPlayerPed->GetCurrentWeaponSlot();
BYTE byteState = pAim[0x1D] >> 6;
if(byteState == 3) pSlot->field_4 = 2;
else if(byteState != 2) pSlot->field_8 = pAim[0x1D] >> 6;
else if(pSlot->field_8 < 2) pSlot->field_8 = 2;
}
//----------------------------------------------------
BOOL CRemotePlayer::FUNC_10017130(int a1, int iSkin, int a3, VECTOR *pPos, float fRotation,
DWORD dwColor, BYTE byteStyle)
{
+1
View File
@@ -86,6 +86,7 @@ public:
void FUNC_100148F0(); // .text:100148F0
void FUNC_10014FF0(); // .text:10014FF0
void FUNC_10017260(BYTE *pSync, int iTime); // .text:10017260
void FUNC_10015760(BYTE *pAim); // .text:10015760
BOOL FUNC_10017130(int a1, int iSkin, int a3, VECTOR *pPos, float fRotation,
DWORD dwColor, BYTE byteStyle); // .text:10017130
void FUNC_10015650(MATRIX4X4 *pMat, VECTOR *pMoveSpeed, float fT); // .text:10015650