diff --git a/src/game/client/components/items.cpp b/src/game/client/components/items.cpp index 526121dd7..096578c06 100644 --- a/src/game/client/components/items.cpp +++ b/src/game/client/components/items.cpp @@ -320,12 +320,15 @@ void CItems::OnRender() } for(auto *pPickup = (CPickup *)GameClient()->m_PredictedWorld.FindFirst(CGameWorld::ENTTYPE_PICKUP); pPickup; pPickup = (CPickup *)pPickup->NextEntity()) { - if(auto *pPrev = (CPickup *)GameClient()->m_PrevPredictedWorld.GetEntity(pPickup->ID(), CGameWorld::ENTTYPE_PICKUP)) + if(pPickup->InDDNetTile()) { - CNetObj_Pickup Data, Prev; - pPickup->FillInfo(&Data); - pPrev->FillInfo(&Prev); - RenderPickup(&Prev, &Data, true); + if(auto *pPrev = (CPickup *)GameClient()->m_PrevPredictedWorld.GetEntity(pPickup->ID(), CGameWorld::ENTTYPE_PICKUP)) + { + CNetObj_Pickup Data, Prev; + pPickup->FillInfo(&Data); + pPrev->FillInfo(&Prev); + RenderPickup(&Prev, &Data, true); + } } } } @@ -369,7 +372,11 @@ void CItems::OnRender() else if(Item.m_Type == NETOBJTYPE_PICKUP) { if(UsePredicted) - continue; + { + auto *pPickup = (CPickup *)GameClient()->m_GameWorld.FindMatch(Item.m_ID, Item.m_Type, pData); + if(pPickup && pPickup->InDDNetTile()) + continue; + } const void *pPrev = Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_ID); if(pPrev) RenderPickup((const CNetObj_Pickup *)pPrev, (const CNetObj_Pickup *)pData); diff --git a/src/game/client/prediction/entities/pickup.cpp b/src/game/client/prediction/entities/pickup.cpp index f8aa7d425..26dff8dcd 100644 --- a/src/game/client/prediction/entities/pickup.cpp +++ b/src/game/client/prediction/entities/pickup.cpp @@ -77,8 +77,13 @@ void CPickup::Move() int index = Collision()->IsMover(m_Pos.x, m_Pos.y, &Flags); if(index) { + m_IsCoreActive = true; m_Core = Collision()->CpSpeed(index, Flags); } + else + { + m_IsCoreActive = false; + } m_Pos += m_Core; } } @@ -91,6 +96,7 @@ CPickup::CPickup(CGameWorld *pGameWorld, int ID, CNetObj_Pickup *pPickup) : m_Type = pPickup->m_Type; m_Subtype = pPickup->m_Subtype; m_Core = vec2(0.f, 0.f); + m_IsCoreActive = false; m_ID = ID; m_Layer = LAYER_GAME; m_Number = 0; diff --git a/src/game/client/prediction/entities/pickup.h b/src/game/client/prediction/entities/pickup.h index 5041a6cd1..b6c248a13 100644 --- a/src/game/client/prediction/entities/pickup.h +++ b/src/game/client/prediction/entities/pickup.h @@ -15,6 +15,7 @@ public: CPickup(CGameWorld *pGameWorld, int ID, CNetObj_Pickup *pPickup); void FillInfo(CNetObj_Pickup *pPickup); bool Match(CPickup *pPickup); + bool InDDNetTile() { return m_IsCoreActive; } private: int m_Type; @@ -24,6 +25,7 @@ private: void Move(); vec2 m_Core; + bool m_IsCoreActive; }; #endif