From c8ac838e840ec859dc5939c59665b32711bb8d51 Mon Sep 17 00:00:00 2001 From: Mohab <133429578+MohabCodeX@users.noreply.github.com> Date: Sun, 23 Nov 2025 14:24:53 +0200 Subject: [PATCH] Enhance marker handling on element attachment and detachment --- .../logic/CStaticFunctionDefinitions.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index 52695b056fc..db003573e1e 100644 --- a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -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(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); @@ -1676,6 +1688,14 @@ bool CStaticFunctionDefinitions::DetachElements(CElement* pElement, CElement* pA pElement->AttachTo(NULL); pElement->GenerateSyncTimeContext(); + if (IS_MARKER(pElement)) + { + CMarker* pMarker = static_cast(pElement); + CColShape* pColShape = pMarker->GetColShape(); + if (pColShape) + RefreshColShapeColliders(pColShape); + } + CBitStream BitStream; BitStream.pBitStream->Write(pElement->GetSyncTimeContext()); BitStream.pBitStream->Write(vecPosition.fX);