Remove unnecessary IClient::SnapItemSize function

The item data size is already returned by the `IClient::SnapGetItem` function and getting only the size is not currently useful, so the additional `IClient::SnapItemSize` function is unnecessary.
This commit is contained in:
Robert Müller 2024-07-14 12:31:52 +02:00
parent e9646ba157
commit 2f6c3abc90
4 changed files with 1 additions and 9 deletions

View file

@ -229,7 +229,6 @@ public:
virtual int SnapNumItems(int SnapId) const = 0;
virtual const void *SnapFindItem(int SnapId, int Type, int Id) const = 0;
virtual CSnapItem SnapGetItem(int SnapId, int Index) const = 0;
virtual int SnapItemSize(int SnapId, int Index) const = 0;
virtual void SnapSetStaticsize(int ItemType, int Size) = 0;

View file

@ -712,12 +712,6 @@ IClient::CSnapItem CClient::SnapGetItem(int SnapId, int Index) const
return Item;
}
int CClient::SnapItemSize(int SnapId, int Index) const
{
dbg_assert(SnapId >= 0 && SnapId < NUM_SNAPSHOT_TYPES, "invalid SnapId");
return m_aapSnapshots[g_Config.m_ClDummy][SnapId]->m_pAltSnap->GetItemSize(Index);
}
const void *CClient::SnapFindItem(int SnapId, int Type, int Id) const
{
if(!m_aapSnapshots[g_Config.m_ClDummy][SnapId])

View file

@ -327,7 +327,6 @@ public:
int GetPredictionTime() override;
CSnapItem SnapGetItem(int SnapId, int Index) const override;
int SnapItemSize(int SnapId, int Index) const override;
const void *SnapFindItem(int SnapId, int Type, int Id) const override;
int SnapNumItems(int SnapId) const override;
void SnapSetStaticsize(int ItemType, int Size) override;

View file

@ -1616,7 +1616,7 @@ void CGameClient::OnNewSnapshot()
FoundGameInfoEx = true;
CServerInfo ServerInfo;
Client()->GetServerInfo(&ServerInfo);
m_GameInfo = GetGameInfo((const CNetObj_GameInfoEx *)Item.m_pData, Client()->SnapItemSize(IClient::SNAP_CURRENT, i), &ServerInfo);
m_GameInfo = GetGameInfo((const CNetObj_GameInfoEx *)Item.m_pData, Item.m_DataSize, &ServerInfo);
}
else if(Item.m_Type == NETOBJTYPE_GAMEDATA)
{