3105: Optimize nameplate rendering. Fix #3103 r=def- a=Learath2

Removes the unnecessary `SnapFindItem` (which is a linear search, ew)

Co-authored-by: Learath <learath2@gmail.com>
This commit is contained in:
bors[bot] 2020-10-15 14:29:25 +00:00 committed by GitHub
commit 5a8fe3d2b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,8 +216,7 @@ void CNamePlates::OnRender()
for(int i = 0; i < MAX_CLIENTS; i++)
{
const void *pInfoRaw = Client()->SnapFindItem(IClient::SNAP_CURRENT, NETOBJTYPE_PLAYERINFO, i);
const CNetObj_PlayerInfo *pInfo = (CNetObj_PlayerInfo *)pInfoRaw;
const CNetObj_PlayerInfo *pInfo = m_pClient->m_Snap.m_paPlayerInfos[i];
if(!pInfo)
{
continue;