implement/match LegoAnimationManager::FindVehicle() (#748)

This commit is contained in:
Ramen2X 2024-03-29 11:50:16 -04:00 committed by GitHub
parent bfc2b76a61
commit 7431d9d650
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 5 deletions

View file

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

View file

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