From 24359a231f09862ad1b82e1779de5e36f95f088c Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 15 Dec 2023 18:08:42 -0500 Subject: [PATCH] Match Isle::Create --- LEGO1/isle.cpp | 18 +++++++++++------- LEGO1/legogamestate.h | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/LEGO1/isle.cpp b/LEGO1/isle.cpp index 64093a04..3b544960 100644 --- a/LEGO1/isle.cpp +++ b/LEGO1/isle.cpp @@ -60,21 +60,25 @@ MxResult Isle::Create(MxDSObject& p_dsObject) InputManager()->SetWorld(this); GameState()->FUN_1003a720(0); - undefined4 currentact = GameState()->GetCurrentAct(); - if (currentact == -1) { - m_unk0x13c = 2; - } - else if (currentact == 1 || currentact == 2) { + switch (GameState()->GetCurrentAct()) { + case 1: GameState()->FUN_1003a720(0x2e); + break; + case 2: + GameState()->FUN_1003a720(0x2e); + break; + case -1: + m_unk0x13c = 2; } if (GameState()->GetUnknown424() == 1) { GameState()->SetUnknown424(0); } - Act1State* state = (Act1State*) GameState()->GetState("Act1State"); + LegoGameState* gameState = GameState(); + Act1State* state = (Act1State*) gameState->GetState("Act1State"); if (state == NULL) { - state = (Act1State*) GameState()->CreateState("Act1State"); + state = (Act1State*) gameState->CreateState("Act1State"); } m_act1state = state; diff --git a/LEGO1/legogamestate.h b/LEGO1/legogamestate.h index f3fa4ebc..656b990c 100644 --- a/LEGO1/legogamestate.h +++ b/LEGO1/legogamestate.h @@ -36,7 +36,7 @@ class LegoGameState { inline MxU8 GetUnknownC() { return m_unk0xc; } inline MxU32 GetUnknown10() { return m_unk0x10; } - inline undefined4 GetCurrentAct() { return m_currentAct; } + inline MxS32 GetCurrentAct() { return m_currentAct; } inline undefined4 GetUnknown424() { return m_unk0x424; } inline void SetDirty(MxBool p_dirty) { m_isDirty = p_dirty; } inline void SetUnknown424(undefined4 p_unk0x424) { m_unk0x424 = p_unk0x424; } @@ -62,7 +62,7 @@ class LegoGameState { LegoState** m_stateArray; // 0x8 MxU8 m_unk0xc; // 0xc MxU32 m_unk0x10; // 0x10 - undefined4 m_currentAct; // 0x14 + MxS32 m_currentAct; // 0x14 LegoBackgroundColor* m_backgroundColor; // 0x18 LegoBackgroundColor* m_tempBackgroundColor; // 0x1c LegoFullScreenMovie* m_fullScreenMovie; // 0x20