From e399d9898dc57874f7b1ebc16dbc0d0bcd445f7c Mon Sep 17 00:00:00 2001 From: Nathan M Gilbert Date: Sun, 22 Oct 2023 19:55:14 +0000 Subject: [PATCH] Fix DeleteObjects --- LEGO1/mxomni.cpp | 9 ++++++--- LEGO1/mxomni.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/LEGO1/mxomni.cpp b/LEGO1/mxomni.cpp index 5a54fb30..5cc5807b 100644 --- a/LEGO1/mxomni.cpp +++ b/LEGO1/mxomni.cpp @@ -411,12 +411,15 @@ MxResult DeleteObject(MxDSAction &p_dsAction) } // OFFSET: LEGO1 0x100159e0 -void DeleteObjects(MxAtomId *p_id, MxU32 p_first, MxU32 p_last) +void DeleteObjects(MxAtomId *p_id, MxS32 p_first, MxS32 p_last) { MxDSAction action; action.SetAtomId(*p_id); - while(p_first <= p_last) { - action.SetUnknown24(p_first++); + action.SetUnknown24(-2); + MxS32 l_first = p_first; + MxS32 l_last = p_last; + while(l_first <= l_last) { + action.SetObjectId(l_first++); DeleteObject(action); } } diff --git a/LEGO1/mxomni.h b/LEGO1/mxomni.h index 18fa381c..c5a15972 100644 --- a/LEGO1/mxomni.h +++ b/LEGO1/mxomni.h @@ -101,5 +101,5 @@ MxVideoManager *MVideoManager(); MxAtomIdCounterSet *AtomIdCounterSet(); MxObjectFactory *ObjectFactory(); void DeleteObject(MxDSAction &ds); -void DeleteObjects(MxAtomId *p_id, MxU32 p_first, MxU32 p_last); +void DeleteObjects(MxAtomId *p_id, MxS32 p_first, MxS32 p_last); #endif // MXOMNI_H