From fd3f08f4c4be3baff037113d9325c78740157519 Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Mon, 16 Jun 2025 23:08:17 +0200 Subject: [PATCH] Clear unknowns in `LegoBuildingInfo` and `LegoBuildingManager` (#1566) * Clear unknowns in `LegoBuildingInfo` and `LegoBuildingManager` * Name remaining unknown in `LegoBuildingManager` --- .../legoomni/include/legobuildingmanager.h | 38 +++--- LEGO1/lego/legoomni/src/actors/act2actor.cpp | 28 ++-- LEGO1/lego/legoomni/src/actors/act3actors.cpp | 6 +- .../src/common/legobuildingmanager.cpp | 129 +++++++++--------- LEGO1/lego/legoomni/src/entity/legoentity.cpp | 2 +- LEGO1/lego/legoomni/src/worlds/act3.cpp | 4 +- LEGO1/lego/legoomni/src/worlds/infocenter.cpp | 2 +- 7 files changed, 107 insertions(+), 102 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legobuildingmanager.h b/LEGO1/lego/legoomni/include/legobuildingmanager.h index bac64396..3d251c98 100644 --- a/LEGO1/lego/legoomni/include/legobuildingmanager.h +++ b/LEGO1/lego/legoomni/include/legobuildingmanager.h @@ -26,10 +26,10 @@ struct LegoBuildingInfo { MxU32 m_sound; // 0x08 MxU32 m_move; // 0x0c MxU8 m_mood; // 0x10 - MxS8 m_unk0x11; // 0x11 - MxS8 m_initialUnk0x11; // 0x12 - initial value loaded to m_unk0x11 + MxS8 m_counter; // 0x11 + MxS8 m_initialCounter; // 0x12 - initial value loaded to m_counter MxU8 m_flags; // 0x13 - float m_unk0x14; // 0x14 + float m_adjustedY; // 0x14 const char* m_boundaryName; // 0x18 float m_x; // 0x1c float m_y; // 0x20 @@ -46,7 +46,7 @@ public: LegoEntity* m_entity; // 0x00 LegoROI* m_roi; // 0x04 MxLong m_time; // 0x08 - float m_unk0x0c; // 0x0c + float m_y; // 0x0c MxBool m_muted; // 0x10 }; @@ -79,16 +79,16 @@ public: MxBool SwitchMood(LegoEntity* p_entity); MxU32 GetAnimationId(LegoEntity* p_entity); MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state); - MxBool FUN_10030000(LegoEntity* p_entity); - MxBool FUN_10030030(MxS32 p_index); - MxBool FUN_10030110(LegoBuildingInfo* p_data); - void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length, MxBool p_haveSound, MxBool p_unk0x28); - void FUN_10030590(); + MxBool DecrementCounter(LegoEntity* p_entity); + MxBool DecrementCounter(MxS32 p_index); + MxBool DecrementCounter(LegoBuildingInfo* p_data); + void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length, MxBool p_haveSound, MxBool p_hideAfterAnimation); + void ClearCounters(); void AdjustHeight(MxS32 p_index); - MxResult FUN_10030630(); + MxResult DetermineBoundaries(); LegoBuildingInfo* GetInfoArray(MxS32& p_length); - void FUN_100307b0(LegoEntity* p_entity, MxS32 p_adjust); - void FUN_10030800(); + void AdjustCounter(LegoEntity* p_entity, MxS32 p_adjust); + void SetInitialCounters(); static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; } @@ -100,13 +100,13 @@ private: static MxS32 g_maxMove[16]; static MxU32 g_maxSound; - MxU8 m_nextVariant; // 0x08 - MxBool m_unk0x09; // 0x09 - AnimEntry* m_entries[5]; // 0x0c - MxS8 m_numEntries; // 0x20 - LegoCacheSound* m_sound; // 0x24 - MxBool m_unk0x28; // 0x28 - LegoWorld* m_world; // 0x2c + MxU8 m_nextVariant; // 0x08 + MxBool m_boundariesDetermined; // 0x09 + AnimEntry* m_entries[5]; // 0x0c + MxS8 m_numEntries; // 0x20 + LegoCacheSound* m_sound; // 0x24 + MxBool m_hideAfterAnimation; // 0x28 + LegoWorld* m_world; // 0x2c }; #endif // LEGOBUILDINGMANAGER_H diff --git a/LEGO1/lego/legoomni/src/actors/act2actor.cpp b/LEGO1/lego/legoomni/src/actors/act2actor.cpp index 91e6cc29..bf531641 100644 --- a/LEGO1/lego/legoomni/src/actors/act2actor.cpp +++ b/LEGO1/lego/legoomni/src/actors/act2actor.cpp @@ -718,11 +718,11 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) switch (m_unk0x1d) { case 0: - if (buildingInfo[12].m_unk0x11) { + if (buildingInfo[12].m_counter) { result = buildingInfo[12].m_entity; *p_param = TRUE; } - else if (buildingInfo[14].m_unk0x11) { + else if (buildingInfo[14].m_counter) { result = buildingInfo[14].m_entity; *p_param = TRUE; } @@ -736,7 +736,7 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) } break; case 1: - if (buildingInfo[13].m_unk0x11) { + if (buildingInfo[13].m_counter) { result = buildingInfo[13].m_entity; *p_param = TRUE; } @@ -750,11 +750,11 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) } break; case 2: - if (buildingInfo[9].m_unk0x11) { + if (buildingInfo[9].m_counter) { result = buildingInfo[9].m_entity; *p_param = TRUE; } - else if (buildingInfo[11].m_unk0x11) { + else if (buildingInfo[11].m_counter) { result = buildingInfo[11].m_entity; *p_param = TRUE; } @@ -768,15 +768,15 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) } break; case 3: - if (buildingInfo[7].m_unk0x11) { + if (buildingInfo[7].m_counter) { result = buildingInfo[7].m_entity; *p_param = TRUE; } - else if (buildingInfo[8].m_unk0x11) { + else if (buildingInfo[8].m_counter) { result = buildingInfo[8].m_entity; *p_param = TRUE; } - else if (buildingInfo[3].m_unk0x11) { + else if (buildingInfo[3].m_counter) { result = buildingInfo[3].m_entity; *p_param = TRUE; } @@ -790,11 +790,11 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) } break; case 4: - if (buildingInfo[5].m_unk0x11) { + if (buildingInfo[5].m_counter) { result = buildingInfo[5].m_entity; *p_param = TRUE; } - else if (buildingInfo[10].m_unk0x11) { + else if (buildingInfo[10].m_counter) { result = buildingInfo[10].m_entity; *p_param = TRUE; } @@ -808,7 +808,7 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) } break; case 5: - if (buildingInfo[4].m_unk0x11) { + if (buildingInfo[4].m_counter) { result = buildingInfo[4].m_entity; *p_param = TRUE; } @@ -822,7 +822,7 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) } break; case 6: - if (buildingInfo[2].m_unk0x11) { + if (buildingInfo[2].m_counter) { result = buildingInfo[2].m_entity; *p_param = TRUE; } @@ -836,7 +836,7 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) } break; case 7: - if (buildingInfo[6].m_unk0x11) { + if (buildingInfo[6].m_counter) { result = buildingInfo[6].m_entity; *p_param = TRUE; } @@ -861,7 +861,7 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) return result; } - if (buildingInfo[15].m_unk0x11) { + if (buildingInfo[15].m_counter) { result = buildingInfo[15].m_entity; *p_param = TRUE; } diff --git a/LEGO1/lego/legoomni/src/actors/act3actors.cpp b/LEGO1/lego/legoomni/src/actors/act3actors.cpp index b4836be1..1bd13278 100644 --- a/LEGO1/lego/legoomni/src/actors/act3actors.cpp +++ b/LEGO1/lego/legoomni/src/actors/act3actors.cpp @@ -653,8 +653,8 @@ void Act3Brickster::Animate(float p_time) assert(SoundManager()->GetCacheSoundManager()); SoundManager()->GetCacheSoundManager()->Play("thpt", NULL, FALSE); - while (m_bInfo->m_unk0x11 > 0 || m_bInfo->m_unk0x11 == -1) { - if (!BuildingManager()->FUN_10030110(m_bInfo)) { + while (m_bInfo->m_counter > 0 || m_bInfo->m_counter == -1) { + if (!BuildingManager()->DecrementCounter(m_bInfo)) { break; } } @@ -865,7 +865,7 @@ MxResult Act3Brickster::FUN_100417c0() float local124; for (MxS32 i = 0; i < length; i++) { - if (bInfo[i].m_unk0x11 < 0 && bInfo[i].m_boundary != NULL && bInfo[i].m_entity != NULL && i != 0 && + if (bInfo[i].m_counter < 0 && bInfo[i].m_boundary != NULL && bInfo[i].m_entity != NULL && i != 0 && (local120 == -1 || i != 15)) { Mx3DPointFloat local188(bInfo[i].m_x, bInfo[i].m_y, bInfo[i].m_z); diff --git a/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp b/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp index c13c22ae..d46b8a49 100644 --- a/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp @@ -253,10 +253,10 @@ void LegoBuildingManager::Init() } m_nextVariant = 0; - m_unk0x09 = FALSE; + m_boundariesDetermined = FALSE; m_numEntries = 0; m_sound = NULL; - m_unk0x28 = FALSE; + m_hideAfterAnimation = FALSE; } // FUNCTION: LEGO1 0x1002fa00 @@ -274,7 +274,7 @@ void LegoBuildingManager::LoadWorldInfo() LegoEntity* entity = (LegoEntity*) world->Find("MxEntity", g_buildingInfoVariants[0]); if (entity) { entity->GetROI()->SetVisibility(TRUE); - m_unk0x09 = FALSE; + m_boundariesDetermined = FALSE; } } else { @@ -286,7 +286,7 @@ void LegoBuildingManager::LoadWorldInfo() } } - m_unk0x09 = FALSE; + m_boundariesDetermined = FALSE; } // FUNCTION: LEGO1 0x1002fa90 @@ -301,7 +301,7 @@ void LegoBuildingManager::CreateBuilding(MxS32 p_index, LegoWorld* p_world) LegoROI* roi = entity->GetROI(); AdjustHeight(p_index); MxMatrix mat = roi->GetLocal2World(); - mat[3][1] = g_buildingInfo[p_index].m_unk0x14; + mat[3][1] = g_buildingInfo[p_index].m_adjustedY; roi->UpdateTransformationRelativeToParent(mat); VideoManager()->Get3DManager()->Moved(*roi); } @@ -316,7 +316,7 @@ void LegoBuildingManager::Reset() g_buildingInfo[i].m_entity = NULL; } - m_unk0x09 = FALSE; + m_boundariesDetermined = FALSE; for (i = 0; i < m_numEntries; i++) { delete m_entries[i]; @@ -343,7 +343,7 @@ MxResult LegoBuildingManager::Write(LegoStorage* p_storage) if (p_storage->Write(&info->m_mood, sizeof(MxU8)) != SUCCESS) { goto done; } - if (p_storage->Write(&info->m_initialUnk0x11, sizeof(MxS8)) != SUCCESS) { + if (p_storage->Write(&info->m_initialCounter, sizeof(MxS8)) != SUCCESS) { goto done; } } @@ -376,11 +376,11 @@ MxResult LegoBuildingManager::Read(LegoStorage* p_storage) if (p_storage->Read(&info->m_mood, sizeof(MxU8)) != SUCCESS) { goto done; } - if (p_storage->Read(&info->m_unk0x11, sizeof(MxS8)) != SUCCESS) { + if (p_storage->Read(&info->m_counter, sizeof(MxS8)) != SUCCESS) { goto done; } - info->m_initialUnk0x11 = info->m_unk0x11; + info->m_initialCounter = info->m_counter; AdjustHeight(i); } @@ -402,15 +402,15 @@ done: // FUNCTION: BETA10 0x10063f1a void LegoBuildingManager::AdjustHeight(MxS32 p_index) { - if (g_buildingInfo[p_index].m_unk0x11 > 0) { - float value = g_buildingInfoDownshift[p_index] - g_buildingInfo[p_index].m_unk0x11; - g_buildingInfo[p_index].m_unk0x14 = - g_buildingInfoInit[p_index].m_unk0x14 - value * g_buildingInfoDownshiftScale[p_index]; + if (g_buildingInfo[p_index].m_counter > 0) { + float value = g_buildingInfoDownshift[p_index] - g_buildingInfo[p_index].m_counter; + g_buildingInfo[p_index].m_adjustedY = + g_buildingInfoInit[p_index].m_adjustedY - value * g_buildingInfoDownshiftScale[p_index]; } - else if (g_buildingInfo[p_index].m_unk0x11 == 0) { - float value = g_buildingInfoDownshift[p_index] - g_buildingInfo[p_index].m_unk0x11; - g_buildingInfo[p_index].m_unk0x14 = - g_buildingInfoInit[p_index].m_unk0x14 - value * g_buildingInfoDownshiftScale[p_index]; + else if (g_buildingInfo[p_index].m_counter == 0) { + float value = g_buildingInfoDownshift[p_index] - g_buildingInfo[p_index].m_counter; + g_buildingInfo[p_index].m_adjustedY = + g_buildingInfoInit[p_index].m_adjustedY - value * g_buildingInfoDownshiftScale[p_index]; if (g_buildingInfo[p_index].m_entity != NULL) { LegoROI* roi = g_buildingInfo[p_index].m_entity->GetROI(); @@ -420,7 +420,7 @@ void LegoBuildingManager::AdjustHeight(MxS32 p_index) } } else { - g_buildingInfo[p_index].m_unk0x14 = g_buildingInfoInit[p_index].m_unk0x14; + g_buildingInfo[p_index].m_adjustedY = g_buildingInfoInit[p_index].m_adjustedY; } } @@ -453,7 +453,7 @@ MxBool LegoBuildingManager::SwitchVariant(LegoEntity* p_entity) LegoBuildingInfo* info = GetInfo(p_entity); - if (info != NULL && info->m_flags & LegoBuildingInfo::c_hasVariants && info->m_unk0x11 == -1) { + if (info != NULL && info->m_flags & LegoBuildingInfo::c_hasVariants && info->m_counter == -1) { LegoROI* roi = p_entity->GetROI(); if (++m_nextVariant >= sizeOfArray(g_buildingInfoVariants)) { m_nextVariant = 0; @@ -587,7 +587,7 @@ void LegoBuildingManager::SetCustomizeAnimFile(const char* p_value) } // FUNCTION: LEGO1 0x10030000 -MxBool LegoBuildingManager::FUN_10030000(LegoEntity* p_entity) +MxBool LegoBuildingManager::DecrementCounter(LegoEntity* p_entity) { LegoBuildingInfo* info = GetInfo(p_entity); @@ -595,7 +595,7 @@ MxBool LegoBuildingManager::FUN_10030000(LegoEntity* p_entity) return FALSE; } - return FUN_10030030(info - g_buildingInfo); + return DecrementCounter(info - g_buildingInfo); } inline LegoBuildingInfo* GetBuildingInfo(MxS32 p_index) @@ -608,7 +608,7 @@ inline LegoBuildingInfo* GetBuildingInfo(MxS32 p_index) } // FUNCTION: LEGO1 0x10030030 -MxBool LegoBuildingManager::FUN_10030030(MxS32 p_index) +MxBool LegoBuildingManager::DecrementCounter(MxS32 p_index) { if (p_index >= sizeOfArray(g_buildingInfo)) { return FALSE; @@ -621,25 +621,25 @@ MxBool LegoBuildingManager::FUN_10030030(MxS32 p_index) MxBool result = TRUE; - if (info->m_unk0x11 < 0) { - info->m_unk0x11 = g_buildingInfoDownshift[p_index]; + if (info->m_counter < 0) { + info->m_counter = g_buildingInfoDownshift[p_index]; } - if (info->m_unk0x11 <= 0) { + if (info->m_counter <= 0) { result = FALSE; } else { LegoROI* roi = info->m_entity->GetROI(); - info->m_unk0x11 -= 2; - if (info->m_unk0x11 == 1) { - info->m_unk0x11 = 0; + info->m_counter -= 2; + if (info->m_counter == 1) { + info->m_counter = 0; roi->SetVisibility(FALSE); } else { AdjustHeight(p_index); MxMatrix mat = roi->GetLocal2World(); - mat[3][1] = g_buildingInfo[p_index].m_unk0x14; + mat[3][1] = g_buildingInfo[p_index].m_adjustedY; roi->UpdateTransformationRelativeToParent(mat); VideoManager()->Get3DManager()->Moved(*roi); } @@ -649,11 +649,11 @@ MxBool LegoBuildingManager::FUN_10030030(MxS32 p_index) } // FUNCTION: LEGO1 0x10030110 -MxBool LegoBuildingManager::FUN_10030110(LegoBuildingInfo* p_data) +MxBool LegoBuildingManager::DecrementCounter(LegoBuildingInfo* p_data) { for (MxS32 i = 0; i < sizeOfArray(g_buildingInfo); i++) { if (&g_buildingInfo[i] == p_data) { - return FUN_10030030(i); + return DecrementCounter(i); } } @@ -661,7 +661,12 @@ MxBool LegoBuildingManager::FUN_10030110(LegoBuildingInfo* p_data) } // FUNCTION: LEGO1 0x10030150 -void LegoBuildingManager::ScheduleAnimation(LegoEntity* p_entity, MxLong p_length, MxBool p_haveSound, MxBool p_unk0x28) +void LegoBuildingManager::ScheduleAnimation( + LegoEntity* p_entity, + MxLong p_length, + MxBool p_haveSound, + MxBool p_hideAfterAnimation +) { m_world = CurrentWorld(); @@ -671,7 +676,7 @@ void LegoBuildingManager::ScheduleAnimation(LegoEntity* p_entity, MxLong p_lengt } if (m_numEntries == 0) { - m_unk0x28 = p_unk0x28; + m_hideAfterAnimation = p_hideAfterAnimation; TickleManager()->RegisterClient(this, 50); } @@ -685,9 +690,9 @@ void LegoBuildingManager::ScheduleAnimation(LegoEntity* p_entity, MxLong p_lengt time += p_length; entry->m_time = time + 1000; - entry->m_unk0x0c = entry->m_roi->GetWorldPosition()[1]; + entry->m_y = entry->m_roi->GetWorldPosition()[1]; entry->m_muted = p_haveSound == FALSE; - FUN_100307b0(p_entity, -2); + AdjustCounter(p_entity, -2); } // FUNCTION: LEGO1 0x10030220 @@ -724,33 +729,33 @@ MxResult LegoBuildingManager::Tickle() MxMatrix local48; MxMatrix locald8; - MxMatrix local120(entry->m_roi->GetLocal2World()); - Mx3DPointFloat local134(local120[3]); + MxMatrix transformationMatrix(entry->m_roi->GetLocal2World()); + Mx3DPointFloat position(transformationMatrix[3]); - ZEROVEC3(local120[3]); + ZEROVEC3(transformationMatrix[3]); locald8.SetIdentity(); - local48 = local120; + local48 = transformationMatrix; - local134[1] = sin(((entry->m_time - time) * 10) * 0.0062831999f) * 0.4 + (entry->m_unk0x0c -= 0.05); - SET3(local120[3], local134); + position[1] = sin(((entry->m_time - time) * 10) * 0.0062831999f) * 0.4 + (entry->m_y -= 0.05); + SET3(transformationMatrix[3], position); - entry->m_roi->UpdateTransformationRelativeToParent(local120); + entry->m_roi->UpdateTransformationRelativeToParent(transformationMatrix); VideoManager()->Get3DManager()->Moved(*entry->m_roi); if (entry->m_time < time) { LegoBuildingInfo* info = GetInfo(entry->m_entity); - if (info->m_unk0x11 && !m_unk0x28) { + if (info->m_counter && !m_hideAfterAnimation) { MxS32 index = info - g_buildingInfo; AdjustHeight(index); MxMatrix mat = entry->m_roi->GetLocal2World(); - mat[3][1] = g_buildingInfo[index].m_unk0x14; + mat[3][1] = g_buildingInfo[index].m_adjustedY; entry->m_roi->UpdateTransformationRelativeToParent(mat); VideoManager()->Get3DManager()->Moved(*entry->m_roi); } else { - info->m_unk0x11 = 0; + info->m_counter = 0; entry->m_roi->SetVisibility(FALSE); } @@ -774,17 +779,17 @@ MxResult LegoBuildingManager::Tickle() // FUNCTION: LEGO1 0x10030590 // FUNCTION: BETA10 0x1006474c -void LegoBuildingManager::FUN_10030590() +void LegoBuildingManager::ClearCounters() { for (MxS32 i = 0; i < sizeOfArray(g_buildingInfo); i++) { - g_buildingInfo[i].m_unk0x11 = -1; - g_buildingInfo[i].m_initialUnk0x11 = -1; + g_buildingInfo[i].m_counter = -1; + g_buildingInfo[i].m_initialCounter = -1; AdjustHeight(i); if (g_buildingInfo[i].m_entity != NULL) { LegoROI* roi = g_buildingInfo[i].m_entity->GetROI(); MxMatrix mat = roi->GetLocal2World(); - mat[3][1] = g_buildingInfo[i].m_unk0x14; + mat[3][1] = g_buildingInfo[i].m_adjustedY; roi->UpdateTransformationRelativeToParent(mat); VideoManager()->Get3DManager()->Moved(*roi); } @@ -793,7 +798,7 @@ void LegoBuildingManager::FUN_10030590() // FUNCTION: LEGO1 0x10030630 // FUNCTION: BETA10 0x100648ab -MxResult LegoBuildingManager::FUN_10030630() +MxResult LegoBuildingManager::DetermineBoundaries() { LegoWorld* world = CurrentWorld(); @@ -859,7 +864,7 @@ MxResult LegoBuildingManager::FUN_10030630() } } - m_unk0x09 = TRUE; + m_boundariesDetermined = TRUE; return SUCCESS; } @@ -867,8 +872,8 @@ MxResult LegoBuildingManager::FUN_10030630() // FUNCTION: BETA10 0x10064db9 LegoBuildingInfo* LegoBuildingManager::GetInfoArray(MxS32& p_length) { - if (!m_unk0x09) { - FUN_10030630(); + if (!m_boundariesDetermined) { + DetermineBoundaries(); } p_length = sizeOfArray(g_buildingInfo); @@ -876,28 +881,28 @@ LegoBuildingInfo* LegoBuildingManager::GetInfoArray(MxS32& p_length) } // FUNCTION: LEGO1 0x100307b0 -void LegoBuildingManager::FUN_100307b0(LegoEntity* p_entity, MxS32 p_adjust) +void LegoBuildingManager::AdjustCounter(LegoEntity* p_entity, MxS32 p_adjust) { LegoBuildingInfo* info = GetInfo(p_entity); if (info != NULL) { - if (info->m_unk0x11 < 0) { - info->m_unk0x11 = g_buildingInfoDownshift[info - g_buildingInfo]; + if (info->m_counter < 0) { + info->m_counter = g_buildingInfoDownshift[info - g_buildingInfo]; } - if (info->m_unk0x11 > 0) { - info->m_unk0x11 += p_adjust; - if (info->m_unk0x11 <= 1 && p_adjust < 0) { - info->m_unk0x11 = 0; + if (info->m_counter > 0) { + info->m_counter += p_adjust; + if (info->m_counter <= 1 && p_adjust < 0) { + info->m_counter = 0; } } } } // FUNCTION: LEGO1 0x10030800 -void LegoBuildingManager::FUN_10030800() +void LegoBuildingManager::SetInitialCounters() { for (MxU32 i = 0; i < sizeOfArray(g_buildingInfo); i++) { - g_buildingInfo[i].m_initialUnk0x11 = g_buildingInfo[i].m_unk0x11; + g_buildingInfo[i].m_initialCounter = g_buildingInfo[i].m_counter; } } diff --git a/LEGO1/lego/legoomni/src/entity/legoentity.cpp b/LEGO1/lego/legoomni/src/entity/legoentity.cpp index 34192c72..467d65d8 100644 --- a/LEGO1/lego/legoomni/src/entity/legoentity.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoentity.cpp @@ -503,7 +503,7 @@ MxLong LegoEntity::Notify(MxParam& p_param) PlantManager()->DecrementCounter(this); break; case e_building: - BuildingManager()->FUN_10030000(this); + BuildingManager()->DecrementCounter(this); break; case e_autoROI: break; diff --git a/LEGO1/lego/legoomni/src/worlds/act3.cpp b/LEGO1/lego/legoomni/src/worlds/act3.cpp index cc6b08e8..48aacd92 100644 --- a/LEGO1/lego/legoomni/src/worlds/act3.cpp +++ b/LEGO1/lego/legoomni/src/worlds/act3.cpp @@ -588,7 +588,7 @@ MxLong Act3::Notify(MxParam& p_param) m_unk0x421e = 0; while (--length >= 0) { - if (info[length].m_unk0x11 < 0 && info[length].m_boundary != NULL && + if (info[length].m_counter < 0 && info[length].m_boundary != NULL && info[length].m_entity != NULL) { m_unk0x421e++; } @@ -665,7 +665,7 @@ MxLong Act3::HandleTransitionEnd() void Act3::ReadyWorld() { PlantManager()->SetInitialCounters(); - BuildingManager()->FUN_10030800(); + BuildingManager()->SetInitialCounters(); AnimationManager()->FUN_1005f6d0(FALSE); VideoManager()->Get3DManager()->SetFrustrum(90.0f, 0.1f, 125.0f); diff --git a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp index 9daa9550..8a41663e 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp @@ -1386,7 +1386,7 @@ void Infocenter::Reset() } PlantManager()->ClearCounters(); - BuildingManager()->FUN_10030590(); + BuildingManager()->ClearCounters(); AnimationManager()->Reset(FALSE); CharacterManager()->ReleaseAllActors(); GameState()->SetCurrentAct(LegoGameState::e_act1);