mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 00:32:45 +03:00
fix(model): correct logic in CM2Model::AttachToParent
This commit is contained in:
parent
3a3b7d5259
commit
642c763612
@ -693,15 +693,20 @@ void CM2Model::AttachToParent(CM2Model* parent, uint32_t id, const C3Vector* pos
|
|||||||
|
|
||||||
this->SetAnimating(0);
|
this->SetAnimating(0);
|
||||||
|
|
||||||
auto& attachmentIndicesById = this->m_shared->m_data->attachmentIndicesById;
|
// Look up parent attachment index by given ID
|
||||||
|
|
||||||
uint16_t attachIndex = 0xFFFF;
|
uint16_t attachIndex = 0xFFFF;
|
||||||
if (parent->m_loaded && id < attachmentIndicesById.count) {
|
|
||||||
attachIndex = attachmentIndicesById[id];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attachIndex == 0xFFFF && !a5) {
|
if (parent->m_loaded) {
|
||||||
return;
|
auto& parentAttachmentIndicesById = parent->m_shared->m_data->attachmentIndicesById;
|
||||||
|
|
||||||
|
if (id < parentAttachmentIndicesById.Count()) {
|
||||||
|
attachIndex = parentAttachmentIndicesById[id];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attachIndex == 0xFFFF && !a5) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->m_attachIndex = attachIndex;
|
this->m_attachIndex = attachIndex;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user