Skip to content
Merged
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
20 changes: 20 additions & 0 deletions Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,18 @@ bool CStaticFunctionDefinitions::AttachElements(CElement* pElement, CElement* pA
pElement->SetAttachedOffsets(vecPosition, vecRotation);
pElement->AttachTo(pAttachedToElement);

if (IS_MARKER(pElement))
{
CMarker* pMarker = static_cast<CMarker*>(pElement);
CVector attachedPosition;
pMarker->GetAttachedPosition(attachedPosition);
pMarker->SetPosition(attachedPosition);

CColShape* pColShape = pMarker->GetColShape();
if (pColShape)
RefreshColShapeColliders(pColShape);
}

CBitStream BitStream;
BitStream.pBitStream->Write(pAttachedToElement->GetID());
BitStream.pBitStream->Write(vecPosition.fX);
Expand Down Expand Up @@ -1676,6 +1688,14 @@ bool CStaticFunctionDefinitions::DetachElements(CElement* pElement, CElement* pA
pElement->AttachTo(NULL);
pElement->GenerateSyncTimeContext();

if (IS_MARKER(pElement))
{
CMarker* pMarker = static_cast<CMarker*>(pElement);
CColShape* pColShape = pMarker->GetColShape();
if (pColShape)
RefreshColShapeColliders(pColShape);
}

CBitStream BitStream;
BitStream.pBitStream->Write(pElement->GetSyncTimeContext());
BitStream.pBitStream->Write(vecPosition.fX);
Expand Down