From 7431d9d65056c2dbeaa6d876bcb13f9d86840839 Mon Sep 17 00:00:00 2001 From: Ramen2X Date: Fri, 29 Mar 2024 11:50:16 -0400 Subject: [PATCH] implement/match LegoAnimationManager::FindVehicle() (#748) --- LEGO1/lego/legoomni/include/legoanimationmanager.h | 2 +- .../legoomni/src/common/legoanimationmanager.cpp | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index 2254f744..1f93f907 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -67,7 +67,7 @@ class LegoAnimationManager : public MxCore { void FUN_1005f6d0(MxBool); void FUN_1005f700(MxBool); MxResult LoadScriptInfo(MxS32 p_scriptIndex); - MxBool FUN_10060140(char* p_name, MxU32& p_index); + MxBool FindVehicle(const char* p_name, MxU32& p_index); MxResult ReadAnimInfo(LegoFile* p_file, AnimInfo* p_info); MxResult ReadModelInfo(LegoFile* p_file, ModelInfo* p_info); void FUN_100603c0(); diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index c48f1c97..d4ee0254 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -254,7 +254,7 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex) for (MxS32 m = 0; m < m_anims[j].m_modelCount; m++) { MxU32 n; - if (FUN_10060140(m_anims[j].m_models[m].m_modelName, n) && m_anims[j].m_models[m].m_unk0x2c) { + if (FindVehicle(m_anims[j].m_models[m].m_modelName, n) && m_anims[j].m_models[m].m_unk0x2c) { m_anims[j].m_unk0x2a[count++] = n; if (count > 3) { break; @@ -294,10 +294,16 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex) return result; } -// STUB: LEGO1 0x10060140 -MxBool LegoAnimationManager::FUN_10060140(char* p_name, MxU32& p_index) +// FUNCTION: LEGO1 0x10060140 +MxBool LegoAnimationManager::FindVehicle(const char* p_name, MxU32& p_index) { - // TODO + for (MxS32 i = 0; i < _countof(g_vehicles); i++) { + if (!strcmpi(p_name, g_vehicles[i].m_name)) { + p_index = i; + return TRUE; + } + } + return FALSE; }