From 64e657733909c200447e96a8b011d50e5d3c3ea9 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Mon, 27 Oct 2025 23:27:53 -0500 Subject: [PATCH] feat(model): implement CM2Model::DetachFromParent --- src/model/CM2Model.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/model/CM2Model.cpp b/src/model/CM2Model.cpp index 0d21bc0..a527a5f 100644 --- a/src/model/CM2Model.cpp +++ b/src/model/CM2Model.cpp @@ -792,7 +792,24 @@ void CM2Model::DetachAllChildrenById(uint32_t id) { } void CM2Model::DetachFromParent() { - // TODO + if (this->m_attachPrev) { + *this->m_attachPrev = this->m_attachNext; + } + + if (this->m_attachNext) { + this->m_attachNext->m_attachPrev = this->m_attachPrev; + } + + this->m_flag40000 = 0; + + this->m_attachPrev = nullptr; + this->m_attachNext = nullptr; + this->m_attachParent = nullptr; + this->m_attachId = -1; + + // TODO this->dword174 = 0 + + this->Release(); } void CM2Model::DetachFromScene() {