From a860e76dbac0e1860486397cb63082432a8fbb37 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 24 May 2025 08:12:07 -0700 Subject: [PATCH] Match `LegoOmni::GetWorldId` (#1517) --- LEGO1/lego/legoomni/include/legomain.h | 3 --- LEGO1/lego/legoomni/src/main/legomain.cpp | 8 ++++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legomain.h b/LEGO1/lego/legoomni/include/legomain.h index fcc144ee..6f2b1e21 100644 --- a/LEGO1/lego/legoomni/include/legomain.h +++ b/LEGO1/lego/legoomni/include/legomain.h @@ -90,9 +90,6 @@ public: return *this; } - World GetId() { return m_id; } - const char* GetKey() { return m_key; } - World m_id; // 0x00 char m_key[20]; // 0x04 MxAtomId* m_atomId; // 0x18 diff --git a/LEGO1/lego/legoomni/src/main/legomain.cpp b/LEGO1/lego/legoomni/src/main/legomain.cpp index fe37070c..632b2943 100644 --- a/LEGO1/lego/legoomni/src/main/legomain.cpp +++ b/LEGO1/lego/legoomni/src/main/legomain.cpp @@ -502,11 +502,15 @@ MxAtomId* LegoOmni::GetWorldAtom(LegoOmni::World p_worldId) } // FUNCTION: LEGO1 0x1005b490 +// FUNCTION: BETA10 0x1008ee69 LegoOmni::World LegoOmni::GetWorldId(const char* p_key) { for (MxS32 i = 0; i < e_numWorlds; i++) { - if ((MxS32) &m_worlds[i] != -4 && !strcmpi(m_worlds[i].GetKey(), p_key)) { - return m_worlds[i].GetId(); + // Note: m_key is never NULL + if (m_worlds[i].m_key != NULL) { + if (!strcmpi(m_worlds[i].m_key, p_key)) { + return m_worlds[i].m_id; + } } }