diff --git a/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp b/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp index 14ec8c6a..3243cb8f 100644 --- a/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp @@ -93,15 +93,15 @@ void LegoExtraActor::VTable0xa4(MxU8& p_und1, MxS32& p_und2) case 1: p_und1 = 1; p_und2 = 1; - return; + break; case 2: p_und1 = 0; p_und2 = 1; - return; + break; default: p_und1 = 1; p_und2 = rand() % p_und2 + 1; - return; + break; } } @@ -110,20 +110,24 @@ MxResult LegoExtraActor::FUN_1002aae0() { LegoPathBoundary* oldEdge = m_boundary; Vector3 dir(m_unk0xec[0]); + Vector3 right(m_unk0xec[1]); Vector3 up(m_unk0xec[2]); - float scale = -1.0f; - float* right = m_unk0xec[1]; - up.Mul(scale); - ((Vector3&) dir).EqualsCrossImpl(right, up.GetData()); + Vector3 unused(m_unk0xec[3]); + + up.Mul(-1.0f); + dir.EqualsCross(&right, &up); + if (m_boundary == m_destEdge->m_faceA) { m_boundary = (LegoPathBoundary*) m_destEdge->m_faceB; } else { m_boundary = (LegoPathBoundary*) m_destEdge->m_faceA; } + if (!m_boundary) { m_boundary = oldEdge; } + LegoPathActor::VTable0x9c(); return SUCCESS; } diff --git a/LEGO1/realtime/matrix.h b/LEGO1/realtime/matrix.h index 8604e0ce..1345e965 100644 --- a/LEGO1/realtime/matrix.h +++ b/LEGO1/realtime/matrix.h @@ -9,6 +9,9 @@ struct UnknownMatrixType { float m_data[4][4]; }; +// Note: Many functions most likely take const references/pointers instead of non-const. +// The class needs to undergo a very careful refactoring to fix that (no matches should break). + // VTABLE: LEGO1 0x100d4350 // SIZE 0x08 class Matrix4 { diff --git a/LEGO1/realtime/vector.h b/LEGO1/realtime/vector.h index ad1f53eb..2911e7c4 100644 --- a/LEGO1/realtime/vector.h +++ b/LEGO1/realtime/vector.h @@ -6,6 +6,9 @@ #include #include +// Note: Many functions most likely take const references/pointers instead of non-const. +// The class needs to undergo a very careful refactoring to fix that (no matches should break). + // VTABLE: LEGO1 0x100d4288 // SIZE 0x08 class Vector2 { @@ -130,7 +133,7 @@ class Vector2 { virtual void Mul(Vector2* p_other) { MulVectorImpl(p_other->m_data); } // vtable+0x60 // FUNCTION: LEGO1 0x10002230 - virtual void Mul(float& p_value) { MulScalarImpl(&p_value); } // vtable+0x5c + virtual void Mul(const float& p_value) { MulScalarImpl((float*) &p_value); } // vtable+0x5c // FUNCTION: LEGO1 0x10002240 virtual void Div(float& p_value) { DivScalarImpl(&p_value); } // vtable+0x68