[saco] Implement/match CPlayerPed::SetShopName(...)

This commit is contained in:
RD42 2024-10-28 20:02:24 +08:00
parent e6e9fc67e2
commit d649636a6d
2 changed files with 31 additions and 0 deletions

View File

@ -1045,3 +1045,33 @@ PCHAR CPlayerPed::GetShopName()
//-----------------------------------------------------------
CHAR szShopName[32];
void CPlayerPed::SetShopName(char *szNewShopName)
{
if(!m_pPed) return;
if(!GamePool_Ped_GetAt(m_dwGTAId)) return;
DWORD dwPedPtr = (DWORD)m_pPed;
if(szNewShopName && strlen(szNewShopName))
{
if(strlen(szNewShopName) <= 31)
{
memset(szShopName, 0, sizeof(szShopName));
strncpy(szShopName, szNewShopName, sizeof(szShopName));
_asm mov eax, dwPedPtr
_asm mov ebx, offset szShopName
_asm mov [eax+1932], ebx
}
}
else
{
_asm mov eax, dwPedPtr
_asm mov byte ptr [eax+1932], 0
}
}
//-----------------------------------------------------------

View File

@ -100,6 +100,7 @@ public:
PCHAR GetLoadedShopName();
void LoadShoppingDataSubsection(PCHAR szSectionName);
PCHAR GetShopName();
void SetShopName(char *szNewShopName);
//char _gap0[813];