prediction/entity: Sync ID getter name with the server/entity

This commit is contained in:
Alexander Akulich 2022-07-14 23:34:08 +03:00
parent 1f264a042d
commit 5169369809
2 changed files with 4 additions and 3 deletions

View file

@ -334,7 +334,7 @@ void CItems::OnRender()
continue;
CProjectileData Data = pProj->GetData();
RenderProjectile(&Data, pProj->ID());
RenderProjectile(&Data, pProj->GetID());
}
for(CEntity *pEnt = GameClient()->m_PredictedWorld.FindFirst(CGameWorld::ENTTYPE_LASER); pEnt; pEnt = pEnt->NextEntity())
{
@ -352,7 +352,7 @@ void CItems::OnRender()
if(pPickup->InDDNetTile())
{
if(auto *pPrev = (CPickup *)GameClient()->m_PrevPredictedWorld.GetEntity(pPickup->ID(), CGameWorld::ENTTYPE_PICKUP))
if(auto *pPrev = (CPickup *)GameClient()->m_PrevPredictedWorld.GetEntity(pPickup->GetID(), CGameWorld::ENTTYPE_PICKUP))
{
CNetObj_Pickup Data, Prev;
pPickup->FillInfo(&Data);

View file

@ -35,6 +35,8 @@ protected:
int m_ObjType;
public:
int GetID() const { return m_ID; }
CEntity(CGameWorld *pGameWorld, int Objtype, vec2 Pos = vec2(0, 0), int ProximityRadius = 0);
virtual ~CEntity();
@ -64,7 +66,6 @@ public:
CEntity *m_pParent;
CEntity *m_pChild;
CEntity *NextEntity() { return m_pNextTypeEntity; }
int ID() { return m_ID; }
void Keep()
{
m_SnapTicks = 0;