mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-04-27 23:03:35 -04:00
Match LegoWorld::Find
(#1301)
This commit is contained in:
parent
3140ba73eb
commit
9b96f3c338
1 changed files with 13 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue