[saco] Match ScrUnk21; memset over the aggregate initializer, and the empty-name branch is the fall-through so the test is negated

This commit is contained in:
ricardoofnl
2026-09-05 10:04:46 +07:00
parent 0d9a1c9f3c
commit 70b76e9806
+6 -5
View File
@@ -1196,22 +1196,23 @@ void ScrUnk21(RPCParameters *rpcParams)
PlayerID sender = rpcParams->sender;
int iLen;
char szName[33];
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
char szName[33] = {0};
memset(szName, 0, sizeof(szName));
bsData.Read(szName, 32);
CPlayerPed *pPlayerPed = pGame->FindPlayerPed();
if(pPlayerPed) {
iLen = strlen(szName);
if(iLen) {
pPlayerPed->SetShopName(szName);
pPlayerPed->LoadShoppingDataSubsection(szName);
} else {
if(!iLen) {
pPlayerPed->SetShopName(NULL);
pPlayerPed->LoadShoppingDataSubsection("");
} else {
pPlayerPed->SetShopName(szName);
pPlayerPed->LoadShoppingDataSubsection(szName);
}
}
}