mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 11:43:04 +08:00
[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:
@@ -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
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user