Skip to content
Permalink
Browse files

Fix GetPosition for CClientPickup

  • Loading branch information...
botder committed Sep 8, 2019
1 parent be76dd4 commit 5727bb3c048e29f91016fe28829eaffd8f9bbbcf
Showing with 18 additions and 2 deletions.
  1. +17 −0 Client/mods/deathmatch/logic/CClientPickup.cpp
  2. +1 −2 Client/mods/deathmatch/logic/CClientPickup.h
@@ -53,6 +53,23 @@ void CClientPickup::Unlink()
m_pPickupManager->RemoveFromList(this);
}

void CClientPickup::GetPosition(CVector& vecPosition) const
{
if (m_pObject)
{
vecPosition = *m_pObject->GetPosition();
}
else if (m_pAttachedToEntity)
{
m_pAttachedToEntity->GetPosition(vecPosition);
vecPosition += m_vecAttachedPosition;
}
else
{
vecPosition = m_vecPosition;
}
}

void CClientPickup::SetPosition(const CVector& vecPosition)
{
// Different from our current position?
@@ -102,8 +102,7 @@ class CClientPickup : public CClientStreamElement, private CClientColCallback
CEntity* GetGameEntity() { return m_pObject; }
const CEntity* GetGameEntity() const { return m_pObject; }

const CVector& GetPosition() { return m_vecPosition; };
void GetPosition(CVector& vecPosition) const { vecPosition = m_vecPosition; };
void GetPosition(CVector& vecPosition) const override;
void SetPosition(const CVector& vecPosition);
void SetModel(unsigned short usModel);

0 comments on commit 5727bb3

Please sign in to comment.
You can’t perform that action at this time.