From 70b76e980600ec2f659812e0c3bde6145330b8a1 Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sat, 5 Sep 2026 10:04:46 +0700 Subject: [PATCH] [saco] Match `ScrUnk21`; `memset` over the aggregate initializer, and the empty-name branch is the fall-through so the test is negated --- saco/net/scriptrpc.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/saco/net/scriptrpc.cpp b/saco/net/scriptrpc.cpp index 6d63f28..80e0ad8 100644 --- a/saco/net/scriptrpc.cpp +++ b/saco/net/scriptrpc.cpp @@ -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); } } }