diff --git a/src/model/CM2Model.cpp b/src/model/CM2Model.cpp index 7526f0d..b229474 100644 --- a/src/model/CM2Model.cpp +++ b/src/model/CM2Model.cpp @@ -777,6 +777,14 @@ void CM2Model::CancelDeferredSequences(uint32_t boneIndex, bool a3) { // TODO } +void CM2Model::DetachAllChildrenById(uint32_t id) { + for (auto model = this->m_attachList; model; model = model->m_attachNext) { + if (model->m_attachId == id) { + model->DetachFromParent(); + } + } +} + void CM2Model::DetachFromParent() { // TODO } diff --git a/src/model/CM2Model.hpp b/src/model/CM2Model.hpp index 2dd47aa..0132509 100644 --- a/src/model/CM2Model.hpp +++ b/src/model/CM2Model.hpp @@ -154,6 +154,7 @@ class CM2Model { void AttachToParent(CM2Model* parent, uint32_t id, const C3Vector* position, int32_t a5); void AttachToScene(CM2Scene* scene); void CancelDeferredSequences(uint32_t boneIndex, bool a3); + void DetachAllChildrenById(uint32_t id); void DetachFromParent(); void DetachFromScene(); void FindKey(M2ModelBoneSeq* sequence, const M2TrackBase& track, uint32_t& currentKey, uint32_t& nextKey, float& ratio);