From 137045e947c216ccd5e0639ec263b9ecb0996031 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Mon, 3 Nov 2025 22:30:05 -0600 Subject: [PATCH] feat(component): implement CCharacterComponent::RemoveLinkpt --- src/component/CCharacterComponent.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/component/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp index db710dc..83620aa 100644 --- a/src/component/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -718,7 +718,23 @@ void CCharacterComponent::PasteTransparent8Bit(void* srcTexture, const BlpPalPix } void CCharacterComponent::RemoveLinkpt(CM2Model* model, GEOCOMPONENTLINKS link) { - // TODO + if (link == ATTACH_NONE) { + return; + } + + if (link == ATTACH_SHIELD || link == ATTACH_HANDL) { + CCharacterComponent::ComponentOpenFingers(model, HAND_LEFT); + } + + if (link == ATTACH_HANDR) { + CCharacterComponent::ComponentOpenFingers(model, HAND_RIGHT); + } + + if (model && model->IsLoaded(0, 0)) { + if (model->HasAttachment(link)) { + model->DetachAllChildrenById(link); + } + } } void CCharacterComponent::UpdateBaseTexture(EGxTexCommand cmd, uint32_t width, uint32_t height, uint32_t depth, uint32_t mipLevel, void* userArg, uint32_t& texelStrideInBytes, const void*& texels) {