WIP: FUN_100720d0 progress

This commit is contained in:
jonschz 2025-07-12 14:39:15 +02:00
parent 00a4861914
commit a3b810452a

View File

@ -116,6 +116,7 @@ void Act3List::Insert(MxS32 p_objectId, InsertMode p_option)
} }
switch (p_option) { switch (p_option) {
// TODO: Consider using an enum
case InsertMode::e_replaceAction: case InsertMode::e_replaceAction:
if (!empty()) { if (!empty()) {
DeleteActionWrapper(); DeleteActionWrapper();
@ -175,49 +176,84 @@ void Act3List::Clear()
// FUNCTION: LEGO1 0x100720d0 // FUNCTION: LEGO1 0x100720d0
void Act3List::FUN_100720d0(MxU32 p_objectId) void Act3List::FUN_100720d0(MxU32 p_objectId)
{ {
// LINE: LEGO1 0x100720db
if (m_unk0x0c) { if (m_unk0x0c) {
return; return;
} }
MxU32 removed = FALSE; MxU32 removed = FALSE;
// LINE: LEGO1 0x100720e6
if (!empty()) { if (!empty()) {
if (p_objectId != 0) {
for (Act3List::iterator it = begin(); it != end(); it++) { if (!p_objectId) {
if ((*it).m_hasStarted && (*it).m_objectId == p_objectId) { // LINE: LEGO1 0x10072131
erase(it);
removed = TRUE;
break;
}
}
}
else {
pop_front(); pop_front();
removed = TRUE; removed = TRUE;
} else {
for (Act3List::iterator it = begin(); it != end(); it++) {
if ((*it).m_hasStarted && (*it).m_objectId == p_objectId) {
erase(it);
removed = TRUE;
break;
}
}
} }
if (removed && size() > 0) { if (removed && size() > 0) {
Act3List::iterator it = begin();
Act3ListElement& firstItem = *(it++);
for (; it != end(); it++) { // TODO: Something is wrong about these first two lines
// LINE: LEGO1 0x1007215d
Act3List::iterator its = begin()++;
Act3ListElement& firstItem = *(its++);
// // LINE: LEGO1 0x100721d4 Not pinnable, appears multiple times
for (Act3List::iterator it = its; it != end(); it++) {
// LINE: LEGO1 0x1007217c
if ((*it).m_unk0x04 == 1) { if ((*it).m_unk0x04 == 1) {
for (Act3List::iterator it2 = begin(); it2 != it;) { // LINE: LEGO1 0x100721a0
for (Act3List::iterator it2 = begin()++; it2 != it; it2 = erase(it2)) {
// LINE: LEGO1 0x10072191
if ((*it2).m_hasStarted) { if ((*it2).m_hasStarted) {
// LINE: LEGO1 0x10072202
DeleteActionWrapper(); DeleteActionWrapper();
// LINE: LEGO1 0x10072209
return; return;
} }
it2 = erase(it2);
} }
} }
} }
// LINE: LEGO1 0x100721d8
if (!firstItem.m_hasStarted) { if (!firstItem.m_hasStarted) {
// LINE: LEGO1 0x100721de
firstItem.m_hasStarted = TRUE; firstItem.m_hasStarted = TRUE;
// // LINE: LEGO1 0x100721e4
InvokeAction(Extra::e_start, *g_act3Script, firstItem.m_objectId, NULL); InvokeAction(Extra::e_start, *g_act3Script, firstItem.m_objectId, NULL);
} }
} }
} }
} }