Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/CClientColTube.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CClientColTube final : public CClientColShape
float GetRadius() { return m_fRadius; };
void SetRadius(float fRadius)
{
m_fRadius = fRadius;
m_fRadius = (fRadius / 2.0f) + 0.15f;
SizeChanged();
};
float GetHeight() { return m_fHeight; };
Expand Down
11 changes: 10 additions & 1 deletion Client/mods/deathmatch/logic/CClientMarker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,15 @@ void CClientMarker::SetSize(float fSize)
pShape->SetRadius(fSize);
break;
}
case COLSHAPE_TUBE:
{
CClientColTube* pShape = static_cast<CClientColTube*>(m_pCollision);
pShape->SetRadius(fSize);
pShape->SetHeight(fSize);
break;
}
}

m_pMarker->SetSize(fSize);
}

Expand Down Expand Up @@ -469,7 +477,8 @@ void CClientMarker::CreateOfType(int iType)
CClient3DMarker* p3DMarker = new CClient3DMarker(this);
p3DMarker->Set3DMarkerType(CClient3DMarker::TYPE_CYLINDER);
m_pMarker = p3DMarker;
m_pCollision = new CClientColCircle(g_pClientGame->GetManager(), INVALID_ELEMENT_ID, vecOrigin, GetSize());

m_pCollision = new CClientColTube(g_pClientGame->GetManager(), INVALID_ELEMENT_ID, vecOrigin, GetSize(), GetSize());
m_pCollision->m_pOwningMarker = this;
m_pCollision->SetHitCallback(this);
break;
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CColTube.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CColTube : public CColShape
float GetRadius() { return m_fRadius; };
void SetRadius(float fRadius)
{
m_fRadius = fRadius;
m_fRadius = (fRadius / 2.0f) + 0.15f;
SizeChanged();
};
float GetHeight() { return m_fHeight; };
Expand Down
16 changes: 15 additions & 1 deletion Server/mods/deathmatch/logic/CMarker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "CMarkerManager.h"
#include "CColCircle.h"
#include "CColSphere.h"
#include "CColTube.h"
#include "CResource.h"
#include "CLogger.h"
#include "Utils.h"
Expand Down Expand Up @@ -398,11 +399,18 @@ void CMarker::UpdateCollisionObject(unsigned char ucOldType)

m_pCollision = new CColCircle(m_pColManager, nullptr, m_vecPosition, m_fSize, true);
}
else if (ucOldType == CMarker::TYPE_CHECKPOINT)
else if (m_ucType == CMarker::TYPE_CYLINDER)
{
if (m_pCollision)
g_pGame->GetElementDeleter()->Delete(m_pCollision);

m_pCollision = new CColTube(m_pColManager, nullptr, m_vecPosition, m_fSize, m_fSize);
}
else if (ucOldType == CMarker::TYPE_CHECKPOINT)
{
if (m_pCollision)
g_pGame->GetElementDeleter()->Delete(m_pCollision);

m_pCollision = new CColSphere(m_pColManager, nullptr, m_vecPosition, m_fSize, true);
}

Expand All @@ -416,6 +424,12 @@ void CMarker::UpdateCollisionObject(unsigned char ucOldType)
{
static_cast<CColCircle*>(m_pCollision)->SetRadius(m_fSize);
}
else if (m_ucType == CMarker::TYPE_CYLINDER)
{
CColTube* pShape = static_cast<CColTube*>(m_pCollision);
pShape->SetRadius(m_fSize);
pShape->SetHeight(m_fSize);
}
else
{
static_cast<CColSphere*>(m_pCollision)->SetRadius(m_fSize);
Expand Down
Loading