From d88ab0a50ac3b69f5b099a6ac4ba557a23fc781e Mon Sep 17 00:00:00 2001 From: jonschz <17198703+jonschz@users.noreply.github.com> Date: Sat, 15 Feb 2025 16:47:55 +0100 Subject: [PATCH] Match `Act2Brick::Create` (#1385) Co-authored-by: jonschz <jonschz@users.noreply.github.com> --- LEGO1/lego/legoomni/src/entity/act2brick.cpp | 9 ++++++++- LEGO1/lego/sources/roi/legoroi.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/LEGO1/lego/legoomni/src/entity/act2brick.cpp b/LEGO1/lego/legoomni/src/entity/act2brick.cpp index b0b6f67e..b182d365 100644 --- a/LEGO1/lego/legoomni/src/entity/act2brick.cpp +++ b/LEGO1/lego/legoomni/src/entity/act2brick.cpp @@ -19,6 +19,7 @@ DECOMP_SIZE_ASSERT(Act2Brick, 0x194) // GLOBAL: LEGO1 0x100f7a38 +// GLOBAL: BETA10 0x101dc480 const LegoChar* Act2Brick::g_lodNames[] = {"xchbase1", "xchblad1", "xchseat1", "xchtail1", "xhback1", "xhljet1", "xhmidl1", "xhmotr1", "xhsidl1", "xhsidr1"}; @@ -51,8 +52,12 @@ MxResult Act2Brick::Create(MxS32 p_index) sprintf(name, "chbrick%d", p_index); m_roi = CharacterManager()->CreateAutoROI(name, g_lodNames[p_index], FALSE); + assert(m_roi); - BoundingSphere sphere = m_roi->GetBoundingSphere(); +#ifndef BETA10 + BoundingSphere sphere; + + sphere.Center() = m_roi->GetBoundingSphere().Center(); sphere.Center()[1] -= 0.3; if (p_index < 6) { @@ -63,6 +68,8 @@ MxResult Act2Brick::Create(MxS32 p_index) } m_roi->SetBoundingSphere(sphere); +#endif + m_roi->SetEntity(this); CurrentWorld()->Add(this); m_unk0x164 = 1; diff --git a/LEGO1/lego/sources/roi/legoroi.h b/LEGO1/lego/sources/roi/legoroi.h index 3e5d4b12..f69936dc 100644 --- a/LEGO1/lego/sources/roi/legoroi.h +++ b/LEGO1/lego/sources/roi/legoroi.h @@ -73,7 +73,9 @@ public: BoundingSphere& GetBoundingSphere() { return m_sphere; } + // FUNCTION: BETA10 0x10013400 void SetEntity(LegoEntity* p_entity) { m_entity = p_entity; } + void SetComp(CompoundObject* p_comp) { comp = p_comp; } void SetBoundingSphere(const BoundingSphere& p_sphere) { m_sphere = m_world_bounding_sphere = p_sphere; } void SetUnknown0x80(const BoundingBox& p_unk0x80) { m_unk0x80 = p_unk0x80; }