mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 11:43:04 +08:00
[saco] Implement/match ScrDisplayGameText and ScrUnk69; the inline memset of a stack buffer is what forces the 8-byte aligned frame
This commit is contained in:
+49
-2
@@ -212,7 +212,32 @@ void ScrUnk87(RPCParameters *rpcParams)
|
||||
pTextDrawPool->FUNC_1001E7F0(wTextDrawId);
|
||||
}
|
||||
}
|
||||
void ScrUnk69(RPCParameters *rpcParams) {}
|
||||
void ScrUnk69(RPCParameters *rpcParams)
|
||||
{
|
||||
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
|
||||
int iBitLength = rpcParams->numberOfBitsOfData;
|
||||
PlayerID sender = rpcParams->sender;
|
||||
|
||||
WORD wTextDrawId;
|
||||
WORD wTextLen;
|
||||
char szText[800];
|
||||
|
||||
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
|
||||
|
||||
wTextLen = 0;
|
||||
|
||||
CTextDrawPool *pTextDrawPool = pNetGame->GetTextDrawPool();
|
||||
if(pTextDrawPool) {
|
||||
bsData.Read(wTextDrawId);
|
||||
bsData.Read(wTextLen);
|
||||
if(wTextLen <= 800) {
|
||||
bsData.Read(szText, wTextLen);
|
||||
szText[wTextLen] = 0;
|
||||
CTextDraw *pTextDraw = (CTextDraw *)pTextDrawPool->GetAt(wTextDrawId);
|
||||
if(pTextDraw) pTextDraw->FUNC_100B2F60(szText);
|
||||
}
|
||||
}
|
||||
}
|
||||
void ScrAddGangZone(RPCParameters *rpcParams)
|
||||
{
|
||||
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
|
||||
@@ -517,7 +542,29 @@ void ScrRemovePlayerFromVehicle(RPCParameters *rpcParams)
|
||||
|
||||
pNetGame->GetPlayerPool()->GetLocalPlayer()->GetPlayerPed()->ExitCurrentVehicle();
|
||||
}
|
||||
void ScrDisplayGameText(RPCParameters *rpcParams) {}
|
||||
void ScrDisplayGameText(RPCParameters *rpcParams)
|
||||
{
|
||||
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
|
||||
int iBitLength = rpcParams->numberOfBitsOfData;
|
||||
PlayerID sender = rpcParams->sender;
|
||||
|
||||
int iStyle, iTime, iLength;
|
||||
char szText[256];
|
||||
|
||||
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
|
||||
|
||||
memset(szText, 0, sizeof(szText));
|
||||
|
||||
bsData.Read(iStyle);
|
||||
bsData.Read(iTime);
|
||||
bsData.Read(iLength);
|
||||
|
||||
if(iLength >= 1 && iLength <= 200) {
|
||||
bsData.Read(szText, iLength);
|
||||
szText[iLength] = 0;
|
||||
pGame->DisplayGameText(szText, iTime, iStyle);
|
||||
}
|
||||
}
|
||||
void ScrSetInterior(RPCParameters *rpcParams)
|
||||
{
|
||||
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
|
||||
|
||||
@@ -11,6 +11,7 @@ public:
|
||||
void FUNC_100B3480(); // .text:100B3480
|
||||
void FUNC_100B34A0(); // .text:100B34A0
|
||||
void FUNC_100B36B0(); // .text:100B36B0
|
||||
void FUNC_100B2F60(char *szText); // .text:100B2F60
|
||||
};
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user