Clear unknowns in LegoAct2State (#1671)

This commit is contained in:
Fabian Neundorf
2025-08-09 00:38:37 +02:00
committed by GitHub
parent 33c4d1fdcb
commit 4eba95c309
3 changed files with 12 additions and 8 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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);