[saco] Implement/match ScrUnk71; CPlayerPool::GetAt will not inline here, so the ternary has to be spelled out, and the attach test is negated

This commit is contained in:
ricardoofnl
2026-09-05 08:09:01 +07:00
parent d8bc0efab5
commit 810a3cffbd
2 changed files with 40 additions and 1 deletions
+1
View File
@@ -172,6 +172,7 @@ public:
BOOL HasObjectAttached(); // .text:100AEE30
void RemoveAttachedObject(int iIndex); // .text:100AEE50
void FUNC_100B0B10(int iIndex, char *pAttachData); // .text:100B0B10
BOOL GetAttachedObjectSlotState(int iIndex); // .text:100AEEB0
void RemoveAllAttachedObjects(); // .text:100B0AB0
void StopCarrying(); // .text:100ADC00
+39 -1
View File
@@ -956,7 +956,45 @@ void ScrUnk43(RPCParameters *rpcParams)
if(iWeapon >= 0 && iWeapon <= 46) pPlayerPed->SetArmedWeapon(iWeapon, false);
}
void ScrUnk71(RPCParameters *rpcParams) {}
void ScrUnk71(RPCParameters *rpcParams)
{
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
int iBitLength = rpcParams->numberOfBitsOfData;
PlayerID sender = rpcParams->sender;
bool bAttach;
int iIndex;
PLAYERID playerId;
char szAttach[52];
CPlayerPed *pPlayerPed;
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
memset(szAttach, 0, sizeof(szAttach));
bsData.Read(playerId);
bsData.Read(iIndex);
bsData.Read(bAttach);
if(bAttach) bsData.Read(szAttach, 52);
CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool();
if(pPlayerPool) {
if(playerId == pPlayerPool->GetLocalPlayerID()) {
pPlayerPed = pPlayerPool->GetLocalPlayer()->GetPlayerPed();
} else {
if(playerId >= MAX_PLAYERS) return;
if(!pPlayerPool->field_2A[playerId]) return;
CNetPlayer *pNetPlayer = pPlayerPool->m_pPlayers[playerId];
pPlayerPed = (pNetPlayer ? pNetPlayer->m_pRemotePlayer : NULL)->m_pPlayerPed;
}
if(pPlayerPed) {
if(!bAttach) pPlayerPed->RemoveAttachedObject(iIndex);
else pPlayerPed->FUNC_100B0B10(iIndex, szAttach);
}
}
}
void ScrUnk29(RPCParameters *rpcParams) {}
void ScrUnk2A(RPCParameters *rpcParams)
{