From ac6eb28dc4d956b6e85921be335e47dacaad2424 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Tue, 26 Dec 2023 21:17:20 -0500 Subject: [PATCH] Implement/match MxStreamer::DeleteObject (#370) --- LEGO1/mxstreamer.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/LEGO1/mxstreamer.cpp b/LEGO1/mxstreamer.cpp index c35a4e8f..1688c1b8 100644 --- a/LEGO1/mxstreamer.cpp +++ b/LEGO1/mxstreamer.cpp @@ -142,7 +142,7 @@ MxResult MxStreamer::FUN_100b99b0(MxDSAction* p_action) return FAILURE; } -// STUB: LEGO1 0x100b99f0 +// FUNCTION: LEGO1 0x100b99f0 MxResult MxStreamer::DeleteObject(MxDSAction* p_dsAction) { MxDSAction tempAction; @@ -156,8 +156,16 @@ MxResult MxStreamer::DeleteObject(MxDSAction* p_dsAction) tempAction.SetUnknown24(p_dsAction->GetUnknown24()); } - // TODO: remove action from list - return FAILURE; + MxResult result = FAILURE; + for (list::iterator it = m_openStreams.begin(); it != m_openStreams.end(); it++) { + const char* id = p_dsAction->GetAtomId().GetInternal(); + if (!id || id == (*it)->GetAtom().GetInternal()) { + tempAction.SetAtomId((*it)->GetAtom()); + result = (*it)->VTable0x24(&tempAction); + } + } + + return result; } // FUNCTION: LEGO1 0x100b9b30