Skip to content

Commit

Permalink
Match LegoWorld::Find (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
foxtacles authored Dec 28, 2024
1 parent 3140ba7 commit 9b96f3c
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions LEGO1/lego/legoomni/src/entity/legoworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,15 +554,15 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)
MxPresenter* presenter;

while (cursor.Next(presenter)) {
MxDSAction* action = presenter->GetAction();
if (!strcmp(action->GetObjectName(), p_name)) {
if (!strcmp(presenter->GetAction()->GetObjectName(), p_name)) {
return presenter;
}
}

return NULL;
}
else if (!strcmp(p_class, "MxEntity")) {

if (!strcmp(p_class, "MxEntity")) {
LegoEntityListCursor cursor(m_entityList);
LegoEntity* entity;

Expand All @@ -579,7 +579,8 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)

return NULL;
}
else if (!strcmp(p_class, "LegoAnimPresenter")) {

if (!strcmp(p_class, "LegoAnimPresenter")) {
MxPresenterListCursor cursor(&m_animPresenters);
MxPresenter* presenter;

Expand All @@ -591,20 +592,18 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)

return NULL;
}
else {
for (MxCoreSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) {
if ((*it)->IsA(p_class) && (*it)->IsA("MxPresenter")) {
MxPresenter* presenter = (MxPresenter*) *it;
MxDSAction* action = presenter->GetAction();

if (!strcmp(action->GetObjectName(), p_name)) {
return *it;
}
for (MxCoreSet::iterator i = m_set0xa8.begin(); i != m_set0xa8.end(); i++) {
if ((*i)->IsA(p_class) && (*i)->IsA("MxPresenter")) {
assert(((MxPresenter*) (*i))->GetAction());

if (!strcmp(((MxPresenter*) (*i))->GetAction()->GetObjectName(), p_name)) {
return *i;
}
}

return NULL;
}

return NULL;
}

// FUNCTION: LEGO1 0x10021790
Expand Down

0 comments on commit 9b96f3c

Please sign in to comment.