Another fix for friendsID
This commit is contained in:
parent
a6f3641c00
commit
1359e37131
@ -1952,8 +1952,19 @@ bool GetPlayerInfo(int idx, player_info_s *info)
|
||||
bool res = g_IEngine->GetPlayerInfo(idx, info);
|
||||
if (!res)
|
||||
return res;
|
||||
// Fix friends ID
|
||||
info->friendsID = g_pPlayerResource->GetAccountID(idx);
|
||||
|
||||
// First try parsing GUID, should always work unless a server is being malicious
|
||||
try
|
||||
{
|
||||
std::string guid = info->guid;
|
||||
guid = guid.substr(5, guid.length() - 6);
|
||||
info->friendsID = std::stoul(guid.c_str());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// Fix friends ID with player resource
|
||||
info->friendsID = g_pPlayerResource->GetAccountID(idx);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user