mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 11:43:04 +08:00
[saco] Implement/match UnkAB; the trailing GetAt only survives DCE when its result gates a return
This commit is contained in:
@@ -3,6 +3,19 @@
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
// 27 bytes, the block the create-actor RPC reads off the wire
|
||||
typedef struct _ACTOR_INFO
|
||||
{
|
||||
ACTORID ActorID;
|
||||
int iModel;
|
||||
VECTOR vecPos;
|
||||
float fRotation;
|
||||
float fHealth;
|
||||
BYTE byteInvulnerable;
|
||||
} ACTOR_INFO;
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
class CActorPool
|
||||
{
|
||||
public:
|
||||
@@ -19,6 +32,13 @@ public:
|
||||
~CActorPool(); // .text:100018E0
|
||||
|
||||
void sub_100016F0(ACTORID ActorID); // .text:100016F0
|
||||
void sub_10001900(ACTOR_INFO *pActorInfo); // .text:10001900
|
||||
|
||||
int GetAt(ACTORID ActorID) {
|
||||
if(ActorID >= MAX_ACTORS) return 0;
|
||||
if(!field_FA4[ActorID]) return 0;
|
||||
return field_4[ActorID];
|
||||
}
|
||||
ACTORID FUNC_100018B0(DWORD dwPtr); // .text:100018B0
|
||||
};
|
||||
|
||||
|
||||
+25
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
#include "../main.h"
|
||||
#include "../game/util.h"
|
||||
#include "../../raknet/StringCompressor.h"
|
||||
|
||||
extern CNetGame* pNetGame;
|
||||
@@ -891,7 +892,30 @@ void FUNC_10011990(BYTE byteType, DWORD dwValue, BYTE byteResult)
|
||||
pNetGame->GetRakClient()->RPC(RPC_ClientCheck,&bsSend,HIGH_PRIORITY,RELIABLE_ORDERED,0,FALSE);
|
||||
}
|
||||
void ClientCheck(RPCParameters *rpcParams) {}
|
||||
void UnkAB(RPCParameters *rpcParams) {}
|
||||
void UnkAB(RPCParameters *rpcParams)
|
||||
{
|
||||
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
|
||||
int iBitLength = rpcParams->numberOfBitsOfData;
|
||||
|
||||
ACTOR_INFO ActorInfo;
|
||||
|
||||
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
|
||||
|
||||
CActorPool *pActorPool = pNetGame->GetActorPool();
|
||||
|
||||
if(!pActorPool) return;
|
||||
|
||||
memset(&ActorInfo,0,sizeof(ACTOR_INFO));
|
||||
bsData.Read((PCHAR)&ActorInfo,sizeof(ACTOR_INFO));
|
||||
|
||||
if(IsValidPedModel(ActorInfo.iModel))
|
||||
{
|
||||
pActorPool->sub_10001900(&ActorInfo);
|
||||
|
||||
// retail still does the lookup here even though nothing follows it
|
||||
if(!pActorPool->GetAt(ActorInfo.ActorID)) return;
|
||||
}
|
||||
}
|
||||
// not registered, kept alive only by the rest of the section
|
||||
void FUNC_1000EBA0(RPCParameters *rpcParams)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user