diff --git a/LEGO1/mxstreamcontroller.cpp b/LEGO1/mxstreamcontroller.cpp index 02d43a01..74df9dc9 100644 --- a/LEGO1/mxstreamcontroller.cpp +++ b/LEGO1/mxstreamcontroller.cpp @@ -215,7 +215,7 @@ MxResult MxStreamController::VTable0x30(MxDSAction* p_action) MxResult result = FAILURE; MxDSAction* action = m_unk0x3c.Find(p_action, TRUE); if (action != NULL) { - MxNextActionDataStart* data = m_nextActionList.Find(action->GetObjectId(), action->GetUnknown24()); + MxNextActionDataStart* data = m_nextActionList.FindAndErase(action->GetObjectId(), action->GetUnknown24()); delete action; delete data; result = SUCCESS; @@ -284,10 +284,10 @@ MxResult MxStreamController::FUN_100c1f00(MxDSAction* p_action) return SUCCESS; } -// STUB: LEGO1 0x100c20b0 +// FUNCTION: LEGO1 0x100c20b0 MxNextActionDataStart* MxStreamController::FindNextActionDataStartFromStreamingAction(MxDSStreamingAction* p_action) { - return NULL; + return m_nextActionList.Find(p_action->GetObjectId(), p_action->GetUnknown24()); } // STUB: LEGO1 0x100c20d0 diff --git a/LEGO1/mxstreamlist.cpp b/LEGO1/mxstreamlist.cpp index 1fa4dd48..d422c1cb 100644 --- a/LEGO1/mxstreamlist.cpp +++ b/LEGO1/mxstreamlist.cpp @@ -30,8 +30,19 @@ MxDSAction* MxStreamListMxDSAction::Find(MxDSAction* p_action, MxBool p_delete) return found; } -// FUNCTION: LEGO1 0x100c2240 +// FUNCTION: LEGO1 0x100c21e0 MxNextActionDataStart* MxStreamListMxNextActionDataStart::Find(MxU32 p_id, MxS16 p_value) +{ + for (iterator it = begin(); it != end(); it++) { + if (p_id == (*it)->GetObjectId() && p_value == (*it)->GetUnknown24()) + return *it; + } + + return NULL; +} + +// FUNCTION: LEGO1 0x100c2240 +MxNextActionDataStart* MxStreamListMxNextActionDataStart::FindAndErase(MxU32 p_id, MxS16 p_value) { MxNextActionDataStart* match = NULL; diff --git a/LEGO1/mxstreamlist.h b/LEGO1/mxstreamlist.h index 6aa63de0..86b9a002 100644 --- a/LEGO1/mxstreamlist.h +++ b/LEGO1/mxstreamlist.h @@ -41,7 +41,8 @@ class MxStreamListMxDSAction : public MxStreamList { // SIZE 0xc class MxStreamListMxNextActionDataStart : public MxStreamList { public: - MxNextActionDataStart* Find(MxU32, MxS16); + MxNextActionDataStart* Find(MxU32 p_id, MxS16 p_value); + MxNextActionDataStart* FindAndErase(MxU32 p_id, MxS16 p_value); }; // SIZE 0xc