From 4eba95c3096fe8f62b52a2213a35cbf5ba7908c7 Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Sat, 9 Aug 2025 00:38:37 +0200 Subject: [PATCH] Clear unknowns in `LegoAct2State` (#1671) --- LEGO1/lego/legoomni/include/legoact2.h | 14 +++++++++----- LEGO1/lego/legoomni/src/worlds/infocenter.cpp | 2 +- LEGO1/lego/legoomni/src/worlds/legoact2.cpp | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoact2.h b/LEGO1/lego/legoomni/include/legoact2.h index f84e9b0d..23d05fae 100644 --- a/LEGO1/lego/legoomni/include/legoact2.h +++ b/LEGO1/lego/legoomni/include/legoact2.h @@ -15,9 +15,13 @@ class MxEndActionNotificationParam; // SIZE 0x10 class LegoAct2State : public LegoState { public: + enum { + c_badEnding = 104 + }; + LegoAct2State() { - m_unk0x08 = 0; + m_state = 0; m_enabled = FALSE; } ~LegoAct2State() override {} @@ -43,14 +47,14 @@ public: // LegoAct2State::`scalar deleting destructor' // FUNCTION: BETA10 0x100151b0 - void SetUnknown0x08(undefined4 p_unk0x08) { m_unk0x08 = p_unk0x08; } + void SetState(MxU32 p_state) { m_state = p_state; } - undefined4 GetUnknown0x08() { return m_unk0x08; } + MxU32 GetState() { return m_state; } // TODO: Most likely getters/setters are not used according to BETA. (?) - undefined4 m_unk0x08; // 0x08 - MxBool m_enabled; // 0x0c + MxU32 m_state; // 0x08 + MxBool m_enabled; // 0x0c }; // VTABLE: LEGO1 0x100d82e0 diff --git a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp index dbf85086..d55dfc85 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp @@ -516,7 +516,7 @@ void Infocenter::ReadyWorld() LegoAct2State* state = (LegoAct2State*) GameState()->GetState("LegoAct2State"); GameState()->FindLoadedAct(); - if (state && state->GetUnknown0x08() == 0x68) { + if (state && state->GetState() == LegoAct2State::c_badEnding) { bg->Enable(TRUE); PlayCutscene(e_badEndMovie, TRUE); m_infocenterState->m_state = InfocenterState::e_playCutscene; diff --git a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp index 9d088e3b..5314ccad 100644 --- a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp +++ b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp @@ -127,7 +127,7 @@ MxResult LegoAct2::Create(MxDSAction& p_dsAction) } m_gameState = state; - m_gameState->m_unk0x08 = 0; + m_gameState->m_state = 0; switch (GameState()->GetLoadedAct()) { case LegoGameState::e_act2: @@ -933,7 +933,7 @@ MxResult LegoAct2::BadEnding() LegoPathActor* actor = m_unk0x1138; actor->SetActorState(LegoPathActor::c_disabled); - m_gameState->SetUnknown0x08(104); + m_gameState->SetState(LegoAct2State::c_badEnding); m_destLocation = LegoGameState::e_infomain; TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);