Skip to content

Commit 5270058

Browse files
authored
Fix source code
1 parent fff1ace commit 5270058

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

Client/mods/deathmatch/logic/CClientColTube.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CClientColTube final : public CClientColShape
2626
float GetRadius() { return m_fRadius; };
2727
void SetRadius(float fRadius)
2828
{
29-
m_fRadius = fRadius;
29+
m_fRadius = (fRadius / 2.0f) + 0.15f;
3030
SizeChanged();
3131
};
3232
float GetHeight() { return m_fHeight; };
@@ -35,7 +35,6 @@ class CClientColTube final : public CClientColShape
3535
m_fHeight = fHeight;
3636
SizeChanged();
3737
};
38-
float AdjustSize(float fSize);
3938

4039
protected:
4140
float m_fRadius;

Client/mods/deathmatch/logic/CClientMarker.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,6 @@ float CClientMarker::GetSize() const
298298
return m_pMarker->GetSize();
299299
}
300300

301-
float CClientColTube::AdjustSize(float fSize)
302-
{
303-
return (fSize / 2.0f) + 0.15f;
304-
}
305-
306301
void CClientMarker::SetSize(float fSize)
307302
{
308303
switch (m_pCollision->GetShapeType())
@@ -322,7 +317,7 @@ void CClientMarker::SetSize(float fSize)
322317
case COLSHAPE_TUBE:
323318
{
324319
CClientColTube* pShape = static_cast<CClientColTube*>(m_pCollision);
325-
pShape->SetRadius(pShape->AdjustSize(fSize));
320+
pShape->SetRadius(fSize);
326321
pShape->SetHeight(fSize);
327322
break;
328323
}

Server/mods/deathmatch/logic/CColTube.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CColTube : public CColShape
2727
float GetRadius() { return m_fRadius; };
2828
void SetRadius(float fRadius)
2929
{
30-
m_fRadius = fRadius;
30+
m_fRadius = (fRadius / 2.0f) + 0.15f;
3131
SizeChanged();
3232
};
3333
float GetHeight() { return m_fHeight; };
@@ -36,7 +36,6 @@ class CColTube : public CColShape
3636
m_fHeight = fHeight;
3737
SizeChanged();
3838
};
39-
float AdjustSize(float fSize);
4039

4140
protected:
4241
bool ReadSpecialData(const int iLine) override;

Server/mods/deathmatch/logic/CMarker.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,6 @@ void CMarker::Callback_OnCollisionDestroy(CColShape* pCollision)
384384
m_pCollision = NULL;
385385
}
386386

387-
float CColTube::AdjustSize(float fSize)
388-
{
389-
return (fSize / 2.0f) + 0.15f;
390-
}
391-
392387
void CMarker::UpdateCollisionObject(unsigned char ucOldType)
393388
{
394389
// Different type than before?
@@ -401,19 +396,22 @@ void CMarker::UpdateCollisionObject(unsigned char ucOldType)
401396
{
402397
if (m_pCollision)
403398
g_pGame->GetElementDeleter()->Delete(m_pCollision);
404-
m_pCollision = new CColCircle(m_pColManager, nullptr, m_vecPosition, m_fSize, true);
399+
400+
m_pCollision = new CColCircle(m_pColManager, nullptr, m_vecPosition, m_fSize, true);
405401
}
406402
else if (m_ucType == CMarker::TYPE_CYLINDER)
407403
{
408404
if (m_pCollision)
409405
g_pGame->GetElementDeleter()->Delete(m_pCollision);
410-
m_pCollision = new CColTube(m_pColManager, nullptr, m_vecPosition, m_fSize, m_fSize);
406+
407+
m_pCollision = new CColTube(m_pColManager, nullptr, m_vecPosition, m_fSize, m_fSize);
411408
}
412409
else if (ucOldType == CMarker::TYPE_CHECKPOINT)
413410
{
414411
if (m_pCollision)
415412
g_pGame->GetElementDeleter()->Delete(m_pCollision);
416-
m_pCollision = new CColSphere(m_pColManager, nullptr, m_vecPosition, m_fSize, true);
413+
414+
m_pCollision = new CColSphere(m_pColManager, nullptr, m_vecPosition, m_fSize, true);
417415
}
418416

419417
m_pCollision->SetCallback(this);
@@ -429,7 +427,7 @@ void CMarker::UpdateCollisionObject(unsigned char ucOldType)
429427
else if (m_ucType == CMarker::TYPE_CYLINDER)
430428
{
431429
CColTube* pShape = static_cast<CColTube*>(m_pCollision);
432-
pShape->SetRadius(pShape->AdjustSize(m_fSize));
430+
pShape->SetRadius(m_fSize);
433431
pShape->SetHeight(m_fSize);
434432
}
435433
else

0 commit comments

Comments
 (0)