From 14661988aab7eb07773d0fb2a73ace31f3a5a66c Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 17 Apr 2024 06:02:41 -0400 Subject: [PATCH] Fix logic / match --- LEGO1/lego/legoomni/include/legoentity.h | 1 + .../lego/legoomni/include/legopathboundary.h | 9 +++++++++ .../lego/legoomni/src/paths/legopathactor.cpp | 20 ++++++++++++------- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoentity.h b/LEGO1/lego/legoomni/include/legoentity.h index 53c6ab3d..c3b2bcf0 100644 --- a/LEGO1/lego/legoomni/include/legoentity.h +++ b/LEGO1/lego/legoomni/include/legoentity.h @@ -76,6 +76,7 @@ class LegoEntity : public MxEntity { inline MxFloat GetWorldSpeed() { return m_worldSpeed; } inline LegoROI* GetROI() { return m_roi; } inline MxU8 GetUnknown0x59() { return m_unk0x59; } + inline MxBool GetCameraFlag() { return m_cameraFlag; } inline void SetFlags(MxU8 p_flags) { m_flags = p_flags; } inline void SetFlag(MxU8 p_flag) { m_flags |= p_flag; } diff --git a/LEGO1/lego/legoomni/include/legopathboundary.h b/LEGO1/lego/legoomni/include/legopathboundary.h index 66c104d9..024e85d2 100644 --- a/LEGO1/lego/legoomni/include/legopathboundary.h +++ b/LEGO1/lego/legoomni/include/legopathboundary.h @@ -47,12 +47,21 @@ class LegoPathBoundary : public LegoWEGEdge { // TEMPLATE: LEGO1 0x1002bee0 // _Tree >::_Kfn,LegoPathActorSetCompare,allocator >::~_Tree >::_Kfn,LegoPathActorSetCompare,allocator >::iterator::_Inc + +// TEMPLATE: LEGO1 0x1002bff0 +// _Tree >::_Kfn,LegoPathActorSetCompare,allocator >::erase + // TEMPLATE: LEGO1 0x1002c440 // _Tree >::_Kfn,LegoPathActorSetCompare,allocator >::find // TEMPLATE: LEGO1 0x1002c4c0 // _Tree >::_Kfn,LegoPathActorSetCompare,allocator >::_Copy +// TEMPLATE: LEGO1 0x1002c630 +// _Tree >::_Kfn,LegoPathActorSetCompare,allocator >::_Erase + // TEMPLATE: LEGO1 0x1002c670 // set >::~set > diff --git a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp index 114c62fe..7d709ceb 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp @@ -435,17 +435,23 @@ MxU32 LegoPathActor::VTable0x6c( LegoPathActorSet lpas(*plpas); for (LegoPathActorSet::iterator itpa = lpas.begin(); itpa != lpas.end(); itpa++) { - LegoPathActor* actor = *itpa; + if (plpas->find(*itpa) != plpas->end()) { + LegoPathActor* actor = *itpa; - if (plpas->find(actor) != plpas->end() && this != actor && (actor->m_state & 0x100) && actor->m_roi && - (actor->m_roi->GetVisibility() || actor->m_cameraFlag)) { - if (actor->m_roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_unk0xe8 != 0 && actor->m_unk0xe8 != 0)) { - VTable0x94(actor, TRUE); - VTable0x94(actor, FALSE); - return 2; + if (this != actor && !(actor->GetState() & 0x100)) { + LegoROI* roi = actor->GetROI(); + + if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) { + if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_unk0xe8 != 0 && actor->m_unk0xe8 != 0)) { + VTable0x94(actor, TRUE); + actor->VTable0x94(this, FALSE); + return 2; + } + } } } } + return 0; }