From 674197555c22e28fd1ce2af3e3b30b28f7207dc7 Mon Sep 17 00:00:00 2001 From: Florian Kaiser Date: Fri, 9 May 2025 20:49:52 +0200 Subject: [PATCH 1/8] Rename `m_list0x68` to `m_pathControllerList` in `LegoWorld` class (#1459) --- LEGO1/lego/legoomni/include/legoworld.h | 22 ++++++++--------- LEGO1/lego/legoomni/src/entity/legoworld.cpp | 26 ++++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index 10ff56ab..11e5e667 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -125,17 +125,17 @@ class LegoWorld : public LegoEntity { // LegoWorld::`scalar deleting destructor' protected: - LegoPathControllerList m_list0x68; // 0x68 - MxPresenterList m_animPresenters; // 0x80 - LegoCameraController* m_cameraController; // 0x98 - LegoEntityList* m_entityList; // 0x9c - LegoCacheSoundList* m_cacheSoundList; // 0xa0 - MxBool m_destroyed; // 0xa4 - MxCoreSet m_set0xa8; // 0xa8 - MxPresenterList m_controlPresenters; // 0xb8 - MxCoreSet m_set0xd0; // 0xd0 - list m_roiList; // 0xe0 - LegoOmni::World m_worldId; // 0xec + LegoPathControllerList m_pathControllerList; // 0x68 + MxPresenterList m_animPresenters; // 0x80 + LegoCameraController* m_cameraController; // 0x98 + LegoEntityList* m_entityList; // 0x9c + LegoCacheSoundList* m_cacheSoundList; // 0xa0 + MxBool m_destroyed; // 0xa4 + MxCoreSet m_set0xa8; // 0xa8 + MxPresenterList m_controlPresenters; // 0xb8 + MxCoreSet m_set0xd0; // 0xd0 + list m_roiList; // 0xe0 + LegoOmni::World m_worldId; // 0xec // name verified by BETA10 0x100c7f59 LegoHideAnimPresenter* m_hideAnim; // 0xf0 diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index 7ced4e38..c6ae2d92 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -32,7 +32,7 @@ DECOMP_SIZE_ASSERT(LegoCacheSoundList, 0x18) DECOMP_SIZE_ASSERT(LegoCacheSoundListCursor, 0x10) // FUNCTION: LEGO1 0x1001ca40 -LegoWorld::LegoWorld() : m_list0x68(TRUE) +LegoWorld::LegoWorld() : m_pathControllerList(TRUE) { m_startupTicks = e_four; m_cameraController = NULL; @@ -100,7 +100,7 @@ void LegoWorld::Destroy(MxBool p_fromDestructor) SetCurrentWorld(NULL); } - m_list0x68.DeleteAll(); + m_pathControllerList.DeleteAll(); if (m_cameraController) { delete m_cameraController; @@ -273,7 +273,7 @@ MxResult LegoWorld::PlaceActor( float p_destScale ) { - LegoPathControllerListCursor cursor(&m_list0x68); + LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; while (cursor.Next(controller)) { @@ -288,7 +288,7 @@ MxResult LegoWorld::PlaceActor( // FUNCTION: LEGO1 0x1001fa70 MxResult LegoWorld::PlaceActor(LegoPathActor* p_actor) { - LegoPathControllerListCursor cursor(&m_list0x68); + LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; while (cursor.Next(controller)) { @@ -308,7 +308,7 @@ MxResult LegoWorld::PlaceActor( Vector3& p_direction ) { - LegoPathControllerListCursor cursor(&m_list0x68); + LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; while (cursor.Next(controller)) { @@ -324,7 +324,7 @@ MxResult LegoWorld::PlaceActor( // FUNCTION: BETA10 0x100da4bf void LegoWorld::RemoveActor(LegoPathActor* p_actor) { - LegoPathControllerListCursor cursor(&m_list0x68); + LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; while (cursor.Next(controller)) { @@ -337,7 +337,7 @@ void LegoWorld::RemoveActor(LegoPathActor* p_actor) // FUNCTION: BETA10 0x100da560 MxBool LegoWorld::ActorExists(LegoPathActor* p_actor) { - LegoPathControllerListCursor cursor(&m_list0x68); + LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; while (cursor.Next(controller)) { @@ -353,7 +353,7 @@ MxBool LegoWorld::ActorExists(LegoPathActor* p_actor) // FUNCTION: BETA10 0x100da621 void LegoWorld::FUN_1001fda0(LegoAnimPresenter* p_presenter) { - LegoPathControllerListCursor cursor(&m_list0x68); + LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; while (cursor.Next(controller)) { @@ -365,7 +365,7 @@ void LegoWorld::FUN_1001fda0(LegoAnimPresenter* p_presenter) // FUNCTION: BETA10 0x100da6b5 void LegoWorld::FUN_1001fe90(LegoAnimPresenter* p_presenter) { - LegoPathControllerListCursor cursor(&m_list0x68); + LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; while (cursor.Next(controller)) { @@ -377,14 +377,14 @@ void LegoWorld::FUN_1001fe90(LegoAnimPresenter* p_presenter) void LegoWorld::AddPath(LegoPathController* p_controller) { p_controller->FUN_10046bb0(this); - m_list0x68.Append(p_controller); + m_pathControllerList.Append(p_controller); } // FUNCTION: LEGO1 0x10020020 // FUNCTION: BETA10 0x100da77c LegoPathBoundary* LegoWorld::FindPathBoundary(const char* p_name) { - LegoPathControllerListCursor cursor(&m_list0x68); + LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; while (cursor.Next(controller)) { @@ -401,7 +401,7 @@ LegoPathBoundary* LegoWorld::FindPathBoundary(const char* p_name) // FUNCTION: LEGO1 0x10020120 MxResult LegoWorld::GetCurrPathInfo(LegoPathBoundary** p_boundaries, MxS32& p_numL) { - LegoPathControllerListCursor cursor(&m_list0x68); + LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; cursor.Next(controller); @@ -795,7 +795,7 @@ void LegoWorld::Enable(MxBool p_enable) } } - LegoPathControllerListCursor pathControllerCursor(&m_list0x68); + LegoPathControllerListCursor pathControllerCursor(&m_pathControllerList); while (pathControllerCursor.Next(controller)) { controller->Enable(FALSE); From 81ce4466283891e27f8b2d3771d0cda41d5af358 Mon Sep 17 00:00:00 2001 From: Florian Kaiser Date: Fri, 9 May 2025 20:54:44 +0200 Subject: [PATCH 2/8] Rename `m_unk0x28` to `m_characterIndex` in `AnimInfo` struct and update references in `LegoAnimationManager` (#1462) --- .../legoomni/include/legoanimationmanager.h | 28 +++++++++---------- .../src/common/legoanimationmanager.cpp | 7 +++-- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index f216ca30..81a8b481 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -32,20 +32,20 @@ struct ModelInfo { // SIZE 0x30 struct AnimInfo { - char* m_name; // 0x00 - MxU32 m_objectId; // 0x04 - MxS16 m_location; // 0x08 - MxBool m_unk0x0a; // 0x0a - MxU8 m_unk0x0b; // 0x0b - MxU8 m_unk0x0c; // 0x0c - MxU8 m_unk0x0d; // 0x0d - float m_unk0x10[4]; // 0x10 - MxU8 m_modelCount; // 0x20 - MxU16 m_unk0x22; // 0x22 - ModelInfo* m_models; // 0x24 - MxS8 m_unk0x28; // 0x28 - MxBool m_unk0x29; // 0x29 - MxS8 m_unk0x2a[3]; // 0x2a + char* m_name; // 0x00 + MxU32 m_objectId; // 0x04 + MxS16 m_location; // 0x08 + MxBool m_unk0x0a; // 0x0a + MxU8 m_unk0x0b; // 0x0b + MxU8 m_unk0x0c; // 0x0c + MxU8 m_unk0x0d; // 0x0d + float m_unk0x10[4]; // 0x10 + MxU8 m_modelCount; // 0x20 + MxU16 m_unk0x22; // 0x22 + ModelInfo* m_models; // 0x24 + MxS8 m_characterIndex; // 0x28 + MxBool m_unk0x29; // 0x29 + MxS8 m_unk0x2a[3]; // 0x2a }; // VTABLE: LEGO1 0x100d8d80 diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 51f9cea1..2e1c4466 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -679,7 +679,7 @@ MxResult LegoAnimationManager::LoadWorldInfo(LegoOmni::World p_worldId) goto done; } - m_anims[j].m_unk0x28 = GetCharacterIndex(m_anims[j].m_name + strlen(m_anims[j].m_name) - 2); + m_anims[j].m_characterIndex = GetCharacterIndex(m_anims[j].m_name + strlen(m_anims[j].m_name) - 2); m_anims[j].m_unk0x29 = FALSE; for (k = 0; k < 3; k++) { @@ -1615,7 +1615,8 @@ MxU16 LegoAnimationManager::FUN_10062110( MxS8 index = GetCharacterIndex(p_roi->GetName()); for (MxU16 i = m_unk0x0e; i <= m_unk0x10; i++) { - if (m_anims[i].m_unk0x28 == index && m_anims[i].m_unk0x0c & p_unk0x0c && m_anims[i].m_unk0x29) { + if (m_anims[i].m_characterIndex == index && m_anims[i].m_unk0x0c & p_unk0x0c && + m_anims[i].m_unk0x29) { MxS32 vehicleId = g_characters[index].m_vehicleId; if (vehicleId >= 0) { MxBool found = FALSE; @@ -1636,7 +1637,7 @@ MxU16 LegoAnimationManager::FUN_10062110( MxU16 unk0x22 = m_anims[i].m_unk0x22; for (i = i + 1; i <= m_unk0x10; i++) { - if (m_anims[i].m_unk0x28 == index && m_anims[i].m_unk0x0c & p_unk0x0c && + if (m_anims[i].m_characterIndex == index && m_anims[i].m_unk0x0c & p_unk0x0c && m_anims[i].m_unk0x29 && m_anims[i].m_unk0x22 < unk0x22) { result = i; unk0x22 = m_anims[i].m_unk0x22; From c59343c220791165fc88a27eb1da005fa1aeff60 Mon Sep 17 00:00:00 2001 From: Florian Kaiser Date: Fri, 9 May 2025 20:55:22 +0200 Subject: [PATCH 3/8] Rename `m_unk0x64` to `m_world` in `LegoAnimMMPresenter` (#1461) --- .../legoomni/include/legoanimmmpresenter.h | 2 +- .../src/common/legoanimmmpresenter.cpp | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimmmpresenter.h b/LEGO1/lego/legoomni/include/legoanimmmpresenter.h index d73cd55d..5c972176 100644 --- a/LEGO1/lego/legoomni/include/legoanimmmpresenter.h +++ b/LEGO1/lego/legoomni/include/legoanimmmpresenter.h @@ -90,7 +90,7 @@ class LegoAnimMMPresenter : public MxCompositePresenter { MxU8 m_unk0x59; // 0x59 MxU32 m_animmanId; // 0x5c LegoTranInfo* m_tranInfo; // 0x60 - LegoWorld* m_unk0x64; // 0x64 + LegoWorld* m_world; // 0x64 MxMatrix* m_unk0x68; // 0x68 LegoROI** m_roiMap; // 0x6c MxU32 m_roiMapSize; // 0x70 diff --git a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp index 21bad45d..d579beb1 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp @@ -30,7 +30,7 @@ LegoAnimMMPresenter::LegoAnimMMPresenter() m_unk0x59 = 0; m_tranInfo = NULL; m_unk0x54 = 0; - m_unk0x64 = NULL; + m_world = NULL; m_unk0x68 = NULL; m_roiMap = NULL; m_roiMapSize = 0; @@ -101,9 +101,9 @@ MxResult LegoAnimMMPresenter::StartAction(MxStreamController* p_controller, MxDS } } - m_unk0x64 = CurrentWorld(); - if (m_unk0x64) { - m_unk0x64->Add(this); + m_world = CurrentWorld(); + if (m_world) { + m_world->Add(this); } VideoManager()->RegisterPresenter(*this); @@ -133,8 +133,8 @@ void LegoAnimMMPresenter::EndAction() if (m_action != NULL) { MxCompositePresenter::EndAction(); - if (m_unk0x64 != NULL) { - m_unk0x64->Remove(this); + if (m_world != NULL) { + m_world->Remove(this); } } } @@ -429,11 +429,11 @@ MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time) LegoPathActor* actor = UserActor(); if (m_tranInfo != NULL && m_tranInfo->m_unk0x14 && m_tranInfo->m_location != -1 && actor != NULL) { - if (m_unk0x64 != NULL) { + if (m_world != NULL) { undefined4 und = 1; if (m_presenter != NULL) { - m_unk0x64->RemoveActor(actor); + m_world->RemoveActor(actor); if (m_tranInfo->m_unk0x29) { Mx3DPointFloat position, direction; @@ -442,7 +442,7 @@ MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time) direction = viewROI->GetWorldDirection(); position[1] -= 1.25; - und = m_unk0x64->PlaceActor(actor, m_presenter, position, direction); + und = m_world->PlaceActor(actor, m_presenter, position, direction); } else { und = 0; @@ -452,7 +452,7 @@ MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time) if (und != 0) { viewROI->WrappedSetLocalTransform(m_tranInfo->m_unk0x2c); VideoManager()->Get3DManager()->Moved(*viewROI); - m_unk0x64->PlaceActor(actor); + m_world->PlaceActor(actor); } if (m_tranInfo->m_unk0x29) { From a3d773f629d01123502ce3bd9adf0ad3fd047818 Mon Sep 17 00:00:00 2001 From: Florian Kaiser Date: Fri, 9 May 2025 21:23:02 +0200 Subject: [PATCH 4/8] Rename functions in `LegoWorldPresenter` : `FUN_10067360` to `LoadWorldPart` and `FUN_100674b0` to `LoadWorldModel`. Update `m_unk0x50` to `m_maxObjectId`. (#1460) --- .../legoomni/include/legoworldpresenter.h | 6 +++--- .../src/entity/legoworldpresenter.cpp | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoworldpresenter.h b/LEGO1/lego/legoomni/include/legoworldpresenter.h index 629aa381..3e853f83 100644 --- a/LEGO1/lego/legoomni/include/legoworldpresenter.h +++ b/LEGO1/lego/legoomni/include/legoworldpresenter.h @@ -50,10 +50,10 @@ class LegoWorldPresenter : public LegoEntityPresenter { // LegoWorldPresenter::`scalar deleting destructor' private: - MxResult FUN_10067360(ModelDbPart& p_part, FILE* p_wdbFile); - MxResult FUN_100674b0(ModelDbModel& p_model, FILE* p_wdbFile, LegoWorld* p_world); + MxResult LoadWorldPart(ModelDbPart& p_part, FILE* p_wdbFile); + MxResult LoadWorldModel(ModelDbModel& p_model, FILE* p_wdbFile, LegoWorld* p_world); - undefined4 m_unk0x50; + MxU32 m_nextObjectId; }; #endif // LEGOWORLDPRESENTER_H diff --git a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp index a5f64321..54bbba6a 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp @@ -46,7 +46,7 @@ void LegoWorldPresenter::configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQ // FUNCTION: LEGO1 0x100665c0 LegoWorldPresenter::LegoWorldPresenter() { - m_unk0x50 = 50000; + m_nextObjectId = 50000; } // FUNCTION: LEGO1 0x10066770 @@ -261,7 +261,7 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world) while (cursor.Next(part)) { if (GetViewLODListManager()->Lookup(part->m_roiName.GetData()) == NULL && - FUN_10067360(*part, wdbFile) != SUCCESS) { + LoadWorldPart(*part, wdbFile) != SUCCESS) { return FAILURE; } } @@ -287,15 +287,15 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world) } else if (g_legoWorldPresenterQuality <= 1 && !strnicmp(worlds[i].m_models[j].m_modelName, "haus", 4)) { if (worlds[i].m_models[j].m_modelName[4] == '3') { - if (FUN_100674b0(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) { + if (LoadWorldModel(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) { return FAILURE; } - if (FUN_100674b0(worlds[i].m_models[j - 2], wdbFile, p_world) != SUCCESS) { + if (LoadWorldModel(worlds[i].m_models[j - 2], wdbFile, p_world) != SUCCESS) { return FAILURE; } - if (FUN_100674b0(worlds[i].m_models[j - 1], wdbFile, p_world) != SUCCESS) { + if (LoadWorldModel(worlds[i].m_models[j - 1], wdbFile, p_world) != SUCCESS) { return FAILURE; } } @@ -303,7 +303,7 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world) continue; } - if (FUN_100674b0(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) { + if (LoadWorldModel(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) { return FAILURE; } } @@ -314,7 +314,7 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world) } // FUNCTION: LEGO1 0x10067360 -MxResult LegoWorldPresenter::FUN_10067360(ModelDbPart& p_part, FILE* p_wdbFile) +MxResult LegoWorldPresenter::LoadWorldPart(ModelDbPart& p_part, FILE* p_wdbFile) { MxResult result; MxU8* buff = new MxU8[p_part.m_partDataLength]; @@ -340,7 +340,7 @@ MxResult LegoWorldPresenter::FUN_10067360(ModelDbPart& p_part, FILE* p_wdbFile) } // FUNCTION: LEGO1 0x100674b0 -MxResult LegoWorldPresenter::FUN_100674b0(ModelDbModel& p_model, FILE* p_wdbFile, LegoWorld* p_world) +MxResult LegoWorldPresenter::LoadWorldModel(ModelDbModel& p_model, FILE* p_wdbFile, LegoWorld* p_world) { MxU8* buff = new MxU8[p_model.m_modelDataLength]; @@ -359,8 +359,8 @@ MxResult LegoWorldPresenter::FUN_100674b0(ModelDbModel& p_model, FILE* p_wdbFile action.SetDirection(p_model.m_direction); action.SetUp(p_model.m_up); - MxU32 objectId = m_unk0x50; - m_unk0x50++; + MxU32 objectId = m_nextObjectId; + m_nextObjectId++; action.SetObjectId(objectId); action.SetAtomId(atom); From 30facd3c9007bbc27677177105372e95383b353f Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 10 May 2025 08:16:18 -0700 Subject: [PATCH 5/8] Match `JetskiRace::Create` (#1463) --- LEGO1/lego/legoomni/src/race/jetskirace.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/LEGO1/lego/legoomni/src/race/jetskirace.cpp b/LEGO1/lego/legoomni/src/race/jetskirace.cpp index 373827ab..d1de13e9 100644 --- a/LEGO1/lego/legoomni/src/race/jetskirace.cpp +++ b/LEGO1/lego/legoomni/src/race/jetskirace.cpp @@ -64,13 +64,12 @@ MxResult JetskiRace::Create(MxDSAction& p_dsAction) m_unk0x130.SetRight(543); m_unk0x130.SetBottom(333); LegoJetski::InitSoundIndices(); - InvokeAction( - Extra::e_start, - m_atomId, - DuneBuggy::GetColorOffset(g_varJSFRNTY5) + (DuneBuggy::GetColorOffset(g_varJSWNSHY5) * 5 + 0xf) * 2, - NULL - ); + + MxS32 streamId = + DuneBuggy::GetColorOffset(g_varJSFRNTY5) + (DuneBuggy::GetColorOffset(g_varJSWNSHY5) * 5 + 0xf) * 2; + InvokeAction(Extra::e_start, m_atomId, streamId, NULL); InvokeAction(Extra::e_start, m_atomId, JetraceScript::c_JetskiDashboard, NULL); + g_unk0x100f119c = TRUE; return result; From 447fcd0c0003961cd1d9214f19efe5c5de1f77f6 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 10 May 2025 08:48:08 -0700 Subject: [PATCH 6/8] Match `LegoCarBuild::FUN_100246e0` (#1464) --- .../lego/legoomni/src/build/legocarbuild.cpp | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp index 65a0dc69..b6933170 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp @@ -875,48 +875,52 @@ undefined4 LegoCarBuild::FUN_100244e0(MxLong p_x, MxLong p_y) } // FUNCTION: LEGO1 0x100246e0 +// FUNCTION: BETA10 0x1006d25a undefined4 LegoCarBuild::FUN_100246e0(MxLong p_x, MxLong p_y) { + undefined4 result = 0; + switch (m_unk0x100) { case 3: FUN_10022f30(); - return 1; + result = 1; + break; case 4: FUN_10022f00(); - return 1; + result = 1; + break; case 6: - if (m_unk0x258->PartIsPlaced(m_unk0x110->GetName())) { - if (SpheresIntersect(m_unk0x114, m_unk0x110->GetWorldBoundingSphere())) { - FUN_10024f70(FALSE); - FUN_100250e0(FALSE); - m_unk0x100 = 0; - m_unk0x110 = NULL; - m_PlaceBrick_Sound->Enable(FALSE); - m_PlaceBrick_Sound->Enable(TRUE); - m_unk0x258->SetUnknown0xbc(1); - return 1; - } + if (m_unk0x258->PartIsPlaced(m_unk0x110->GetName()) && + SpheresIntersect(m_unk0x114, m_unk0x110->GetWorldBoundingSphere())) { + FUN_10024f70(FALSE); + FUN_100250e0(FALSE); + m_unk0x100 = 0; + m_unk0x110 = NULL; + m_PlaceBrick_Sound->Enable(FALSE); + m_PlaceBrick_Sound->Enable(TRUE); + m_unk0x258->SetUnknown0xbc(1); } - - if (m_unk0x258->FUN_10079c30(m_unk0x110->GetName())) { + else if (m_unk0x258->FUN_10079c30(m_unk0x110->GetName())) { if (SpheresIntersect(m_unk0x114, m_unk0x110->GetWorldBoundingSphere())) { m_PlaceBrick_Sound->Enable(FALSE); m_PlaceBrick_Sound->Enable(TRUE); FUN_100236d0(); - return 1; } - + else { + VTable0x6c(); + m_unk0x100 = 5; + } + } + else { VTable0x6c(); m_unk0x100 = 5; - return 1; } - VTable0x6c(); - m_unk0x100 = 5; - return 1; - default: - return 0; + result = 1; + break; } + + return result; } // FUNCTION: LEGO1 0x10024850 From fff2021bb552de98630670c538062dd98565d4d3 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 10 May 2025 09:11:53 -0700 Subject: [PATCH 7/8] Match `Hospital::ReadyWorld` (#1465) --- LEGO1/lego/legoomni/src/worlds/hospital.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LEGO1/lego/legoomni/src/worlds/hospital.cpp b/LEGO1/lego/legoomni/src/worlds/hospital.cpp index c393d117..25c04ced 100644 --- a/LEGO1/lego/legoomni/src/worlds/hospital.cpp +++ b/LEGO1/lego/legoomni/src/worlds/hospital.cpp @@ -201,6 +201,7 @@ void Hospital::ReadyWorld() PlayAction(hospitalScript[m_hospitalState->m_unk0x0c]); m_currentAction = hospitalScript[m_hospitalState->m_unk0x0c]; + m_unk0x108 = 1; } else { m_unk0x100 = 1; @@ -210,10 +211,9 @@ void Hospital::ReadyWorld() PlayAction(HospitalScript::c_hho003cl_RunAnim); m_currentAction = HospitalScript::c_hho003cl_RunAnim; + m_unk0x108 = 1; } - m_unk0x108 = 1; - FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); } From 00ac0327614eeeb12d4e6ea31d71a30e78c71617 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 11 May 2025 02:37:02 +0200 Subject: [PATCH 8/8] Fix input to FUN_10064740 (#1467) --- LEGO1/lego/legoomni/src/worlds/isle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index 5fb87505..9d3eb8e7 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -503,7 +503,7 @@ MxLong Isle::HandlePathStruct(LegoPathStructNotificationParam& p_param) break; case 0x131: if (m_act1state->m_unk0x018 != 10) { - AnimationManager()->FUN_10064740(FALSE); + AnimationManager()->FUN_10064740(NULL); } result = 1; break;