Match LegoWorld::Find ()

This commit is contained in:
Christian Semmler 2024-12-28 13:17:03 -07:00 committed by GitHub
parent 3140ba73eb
commit 9b96f3c338
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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