mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
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:
parent
e9646ba157
commit
2f6c3abc90
|
@ -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;
|
||||
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue