Match LegoOmni::GetWorldId (#1517)

This commit is contained in:
Christian Semmler
2025-05-24 08:12:07 -07:00
committed by GitHub
parent 90b5c27a8b
commit a860e76dba
2 changed files with 6 additions and 5 deletions

View File

@@ -90,9 +90,6 @@ public:
return *this; return *this;
} }
World GetId() { return m_id; }
const char* GetKey() { return m_key; }
World m_id; // 0x00 World m_id; // 0x00
char m_key[20]; // 0x04 char m_key[20]; // 0x04
MxAtomId* m_atomId; // 0x18 MxAtomId* m_atomId; // 0x18

View File

@@ -502,11 +502,15 @@ MxAtomId* LegoOmni::GetWorldAtom(LegoOmni::World p_worldId)
} }
// FUNCTION: LEGO1 0x1005b490 // FUNCTION: LEGO1 0x1005b490
// FUNCTION: BETA10 0x1008ee69
LegoOmni::World LegoOmni::GetWorldId(const char* p_key) LegoOmni::World LegoOmni::GetWorldId(const char* p_key)
{ {
for (MxS32 i = 0; i < e_numWorlds; i++) { for (MxS32 i = 0; i < e_numWorlds; i++) {
if ((MxS32) &m_worlds[i] != -4 && !strcmpi(m_worlds[i].GetKey(), p_key)) { // Note: m_key is never NULL
return m_worlds[i].GetId(); if (m_worlds[i].m_key != NULL) {
if (!strcmpi(m_worlds[i].m_key, p_key)) {
return m_worlds[i].m_id;
}
} }
} }