implement LegoOmni::FindByEntityIdOrAtomId (#435)

* push changes

* Match and add annotations

* Fix annotations

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Misha
2024-01-13 20:34:54 -05:00
committed by GitHub
parent 8b34b38ac0
commit 7f7e6e37dd
8 changed files with 49 additions and 2 deletions

View File

@@ -23,6 +23,7 @@
#include "mxtransitionmanager.h"
DECOMP_SIZE_ASSERT(LegoWorldList, 0x18);
DECOMP_SIZE_ASSERT(LegoWorldListCursor, 0x10);
// GLOBAL: LEGO1 0x100f451c
MxAtomId* g_copterScript = NULL;
@@ -597,10 +598,20 @@ void LegoOmni::RemoveWorld(const MxAtomId&, MxLong)
// TODO
}
// STUB: LEGO1 0x1005b0c0
// FUNCTION: LEGO1 0x1005b0c0
LegoEntity* LegoOmni::FindByEntityIdOrAtomId(const MxAtomId& p_atom, MxS32 p_entityid)
{
// TODO
if (m_worldList) {
LegoWorld* world;
LegoWorldListCursor cursor(m_worldList);
while (cursor.Next(world)) {
if ((p_entityid == -1 || world->GetEntityId() == p_entityid) &&
(!p_atom.GetInternal() || world->GetAtom() == p_atom))
return world;
}
}
return NULL;
}