diff --git a/LEGO1/mxstreamcontroller.cpp b/LEGO1/mxstreamcontroller.cpp index 74df9dc9..e45435ac 100644 --- a/LEGO1/mxstreamcontroller.cpp +++ b/LEGO1/mxstreamcontroller.cpp @@ -290,9 +290,22 @@ MxNextActionDataStart* MxStreamController::FindNextActionDataStartFromStreamingA return m_nextActionList.Find(p_action->GetObjectId(), p_action->GetUnknown24()); } -// STUB: LEGO1 0x100c20d0 +// FUNCTION: LEGO1 0x100c20d0 MxBool MxStreamController::FUN_100c20d0(MxDSObject& p_obj) { - // TODO + if (m_subscriberList.Find(&p_obj)) + return FALSE; + + if (p_obj.IsA("MxDSMultiAction")) { + MxDSActionList* actions = ((MxDSMultiAction&) p_obj).GetActionList(); + MxDSActionListCursor cursor(actions); + MxDSAction* action; + + while (cursor.Next(action)) { + if (!FUN_100c20d0(*action)) + return FALSE; + } + } + return TRUE; } diff --git a/LEGO1/mxstreamlist.cpp b/LEGO1/mxstreamlist.cpp index d422c1cb..729b0d7b 100644 --- a/LEGO1/mxstreamlist.cpp +++ b/LEGO1/mxstreamlist.cpp @@ -5,6 +5,20 @@ DECOMP_SIZE_ASSERT(MxStreamListMxDSAction, 0xc); DECOMP_SIZE_ASSERT(MxStreamListMxNextActionDataStart, 0xc); DECOMP_SIZE_ASSERT(MxStreamListMxDSSubscriber, 0xc); +// FUNCTION: LEGO1 0x100b8450 +MxDSSubscriber* MxStreamListMxDSSubscriber::Find(MxDSObject* p_object) +{ + for (iterator it = begin(); it != end(); it++) { + if (p_object->GetObjectId() == -1 || p_object->GetObjectId() == (*it)->GetObjectId()) { + if (p_object->GetUnknown24() == -2 || p_object->GetUnknown24() == (*it)->GetUnknown48()) { + return *it; + } + } + } + + return NULL; +} + // FUNCTION: LEGO1 0x100bfa80 MxDSAction* MxStreamListMxDSAction::Find(MxDSAction* p_action, MxBool p_delete) { diff --git a/LEGO1/mxstreamlist.h b/LEGO1/mxstreamlist.h index 86b9a002..f9164bfb 100644 --- a/LEGO1/mxstreamlist.h +++ b/LEGO1/mxstreamlist.h @@ -46,6 +46,9 @@ public: }; // SIZE 0xc -class MxStreamListMxDSSubscriber : public MxStreamList {}; +class MxStreamListMxDSSubscriber : public MxStreamList { +public: + MxDSSubscriber* Find(MxDSObject* p_object); +}; #endif // MXSTREAMLIST_H