Implement/match LegoOmni::GetScriptIndex (#571)

* Implement/match LegoOmni::GetScriptIndex

* Fix type

* Fix
This commit is contained in:
Christian Semmler
2024-02-16 20:10:42 -05:00
committed by GitHub
parent c67f613b8d
commit b47412183b
9 changed files with 35 additions and 25 deletions

View File

@@ -84,7 +84,7 @@ MxResult LegoWorld::Create(MxDSAction& p_dsAction)
if (p_dsAction.GetFlags() & MxDSAction::c_enabled) {
if (CurrentWorld()) {
CurrentWorld()->Enable(0);
CurrentWorld()->Enable(FALSE);
}
SetCurrentWorld(this);
@@ -92,7 +92,7 @@ MxResult LegoWorld::Create(MxDSAction& p_dsAction)
}
SetIsWorldActive(TRUE);
m_unk0xec = -1;
m_scriptIndex = -1;
return SUCCESS;
}
@@ -169,8 +169,8 @@ void LegoWorld::Destroy(MxBool p_fromDestructor)
}
}
if (m_unk0xec != -1 && m_set0xd0.empty()) {
PlantManager()->FUN_100263a0(m_unk0xec);
if (m_scriptIndex != -1 && m_set0xd0.empty()) {
PlantManager()->FUN_100263a0(m_scriptIndex);
BuildingManager()->FUN_1002fb30();
}
@@ -574,9 +574,9 @@ void LegoWorld::Enable(MxBool p_enable)
Lego()->SetNavController(m_cameraController->GetNavController());
}
if (m_unk0xec != -1) {
PlantManager()->FUN_10026360(m_unk0xec);
AnimationManager()->FUN_1005f720(m_unk0xec);
if (m_scriptIndex != -1) {
PlantManager()->FUN_10026360(m_scriptIndex);
AnimationManager()->FUN_1005f720(m_scriptIndex);
BuildingManager()->FUN_1002fa00();
AnimationManager()->FUN_1005f0b0();
}
@@ -597,8 +597,8 @@ void LegoWorld::Enable(MxBool p_enable)
AnimationManager()->FUN_1005ee80(FALSE);
m_set0xd0.insert(this);
if (m_unk0xec != -1) {
PlantManager()->FUN_100263a0(m_unk0xec);
if (m_scriptIndex != -1) {
PlantManager()->FUN_100263a0(m_scriptIndex);
BuildingManager()->FUN_1002fb30();
}

View File

@@ -39,9 +39,9 @@ LegoWorldPresenter::~LegoWorldPresenter()
{
MxBool result = FALSE;
if (m_entity) {
undefined4 world = ((LegoWorld*) m_entity)->GetUnknown0xec();
PlantManager()->FUN_10026360(world);
AnimationManager()->FUN_1005f720(world);
MxS32 scriptIndex = ((LegoWorld*) m_entity)->GetScriptIndex();
PlantManager()->FUN_10026360(scriptIndex);
AnimationManager()->FUN_1005f720(scriptIndex);
BuildingManager()->FUN_1002fa00();
result = ((LegoWorld*) m_entity)->VTable0x5c();
}
@@ -189,9 +189,9 @@ void LegoWorldPresenter::ParseExtra()
data[len] = 0;
if (KeyValueStringParse(output, g_strWORLD, data)) {
char* worldName = strtok(output, g_parseExtraTokens);
LoadWorld(worldName, (LegoWorld*) m_entity);
((LegoWorld*) m_entity)->SetUnknown0xec(Lego()->FUN_1005b490(worldName));
char* worldKey = strtok(output, g_parseExtraTokens);
LoadWorld(worldKey, (LegoWorld*) m_entity);
((LegoWorld*) m_entity)->SetScriptIndex(Lego()->GetScriptIndex(worldKey));
}
}
}