[saco] Implement/match CPlayerPed::FUNC_100AE6A0; the table lookup returns a signed short, which is what sign-extends the low half of the packed result

This commit is contained in:
ricardoofnl
2026-09-05 10:31:33 +07:00
parent f6708ef126
commit 8df42ea4b3
2 changed files with 18 additions and 0 deletions
+17
View File
@@ -18,6 +18,15 @@ extern BOOL bIgnoreNextExit;
extern BYTE *pbyteCurrentPlayer;
extern int iGtaVersion;
// all three live in the translation unit at 0x100A4xxx, which also reads them
extern int VAR_10151658;
extern int VAR_1015165C;
extern float VAR_10151660;
// .text:1009CFD0, lives in another translation unit; it returns -1 when the lookup
// fails, so the return has to be signed
short FUNC_1009CFD0(int a1);
typedef char CPlayerPed_size_probe[sizeof(CPlayerPed) == 0x32D ? 1 : -1];
typedef char CPlayerPed_2BD_probe[offsetof(CPlayerPed, field_2BD) == 0x2BD ? 1 : -1];
@@ -2325,3 +2334,11 @@ void CPlayerPed::FUNC_100AD440()
field_2B9 = 0;
}
//-----------------------------------------------------------
DWORD CPlayerPed::FUNC_100AE6A0()
{
short sIndex = FUNC_1009CFD0(FUNC_100B4430(VAR_10151658, VAR_1015165C));
return (((BYTE)VAR_10151660 | 0xFFFF8000) << 16) | sIndex;
}
//-----------------------------------------------------------
+1
View File
@@ -261,6 +261,7 @@ public:
void FUNC_100AD440(); // .text:100AD440
int m_iCellPhoneEnabled;
int field_4C[10];
struc_97 field_74[10];