[saco] Implement/match FUNC_10014E60; writing the snap tail at both exits lets the merge hoist the field_17C load above the IsAdded branch

This commit is contained in:
ricardoofnl committed 2026-09-05 10:07:57 +07:00
1 parent 8b78747e06
commit ef8d3e3354
2 files changed
+42 -1

No files matched your search

+37
View File
@@ -23,6 +23,7 @@ typedef char CRemotePlayer_offsets[(
offsetof(CRemotePlayer, field_10A) == 0x10A &&
offsetof(CRemotePlayer, field_10B) == 0x10B &&
offsetof(CRemotePlayer, field_10C) == 0x10C &&
offsetof(CRemotePlayer, field_160) == 0x160 &&
offsetof(CRemotePlayer, field_17C) == 0x17C &&
offsetof(CRemotePlayer, field_188) == 0x188 &&
offsetof(CRemotePlayer, field_194) == 0x194 &&
@@ -409,6 +410,42 @@ void CRemotePlayer::FUNC_10017260(BYTE *pSync, int iTime)
//----------------------------------------------------
void CRemotePlayer::FUNC_10014E60()
{
if(!m_pPlayerPed) return;
MATRIX4X4 mat;
VECTOR vecMove;
m_pPlayerPed->GetMatrix(&mat);
if(!m_pPlayerPed->IsAdded()) {
mat.pos.X = field_17C.X;
mat.pos.Y = field_17C.Y;
m_pPlayerPed->SetMatrix(mat);
return;
}
field_160 = FloatOffset(field_17C.X, mat.pos.X);
field_164 = FloatOffset(field_17C.Y, mat.pos.Y);
if(field_160 <= 0.01f && field_164 <= 0.01f) return;
if(field_160 > 2.0f || field_164 > 2.0f) {
mat.pos.X = field_17C.X;
mat.pos.Y = field_17C.Y;
m_pPlayerPed->SetMatrix(mat);
return;
}
m_pPlayerPed->GetMoveSpeedVector(&vecMove);
if(field_160 > 0.001f) vecMove.X = (field_17C.X - mat.pos.X) * 0.1f + vecMove.X;
if(field_164 > 0.001f) vecMove.Y = (field_17C.Y - mat.pos.Y) * 0.1f + vecMove.Y;
m_pPlayerPed->SetMoveSpeedVector(vecMove);
}
//----------------------------------------------------
void CRemotePlayer::FUNC_10015460()
{
MATRIX4X4 mat;
+5 -1
View File
@@ -36,7 +36,10 @@ public:
int field_10C;
int field_110;
char _gap114[88];
char _gap114[76];
float field_160;
float field_164;
char _gap168[4];
float quat16C[4];
VECTOR field_17C;
VECTOR field_188;
@@ -91,6 +94,7 @@ public:
void FUNC_100148F0(); // .text:100148F0
void FUNC_10014FF0(); // .text:10014FF0
void FUNC_10017260(BYTE *pSync, int iTime); // .text:10017260
void FUNC_10014E60(); // .text:10014E60
void FUNC_10015460(); // .text:10015460
void FUNC_10015760(BYTE *pAim); // .text:10015760
BOOL FUNC_10017130(int a1, int iSkin, int a3, VECTOR *pPos, float fRotation,