Created
March 17, 2021 23:54
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Actor *__fastcall BaseProcMgr::getNextActor(BaseProcMgr *this, sead::CriticalSection *cs, Actor *actor, u8 flags) | |
{ | |
// [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND] | |
if ( &this->procMapCritSection != cs ) | |
return 0LL; | |
if ( !actor ) | |
{ | |
node = this->procMap.mRoot; | |
if ( node ) | |
{ | |
while ( 1 ) | |
{ | |
v8 = node->left; | |
if ( !v8 ) | |
break; | |
v8->color = v8->color & 1 | (unsigned __int64)node; | |
node = node->left; | |
} | |
} | |
this->lastProcMapNode = node; | |
if ( !node ) | |
goto LABEL_11; | |
while ( 1 ) | |
{ | |
LABEL_25: | |
v6 = (BaseProc *)node->value; | |
if ( !v6 ) | |
return (Actor *)v6; | |
if ( ((flags & 0x20) != 0 || (v6->_.mFlags & 2) == 0) && flags & 0x40 | v6->_.mFlags & 1 ) | |
{ | |
v13 = (unsigned __int8)v6->_.state; | |
if ( v13 == 3 ) | |
{ | |
if ( (flags & 2) != 0 ) | |
goto LABEL_38; | |
} | |
else if ( (v13 != 2 || (flags & 1) != 0) | |
&& ((flags & 2) != 0 || (v6->_.mStateFlags & 1) == 0) | |
&& ((flags & 4) != 0 || v6->_.state) ) | |
{ | |
LABEL_38: | |
if ( (flags & 8) != 0 || ksys::act::BaseProcMgr::isAccessingProcSafe(this, v6, 0LL) ) | |
return (Actor *)v6; | |
goto LABEL_40; | |
} | |
} | |
LABEL_40: | |
node = v6->_.baseProcMapNode.next; | |
if ( !node ) | |
{ | |
v14 = this->lastProcMapNode; | |
if ( !v14 ) | |
return 0LL; | |
v15 = v14->right; | |
if ( !v15 ) | |
{ | |
while ( 1 ) | |
{ | |
node = (StringMapNode *)(v14->color & 0xFFFFFFFFFFFFFFFELL); | |
if ( !node ) | |
break; | |
v12 = node->left == v14; | |
v14 = (StringMapNode *)(v14->color & 0xFFFFFFFFFFFFFFFELL); | |
if ( v12 ) | |
goto LABEL_24; | |
} | |
v6 = 0LL; | |
this->lastProcMapNode = 0LL; | |
return (Actor *)v6; | |
} | |
v15->color = v15->color & 1 | (unsigned __int64)v14; | |
for ( node = v14->right; ; node = node->left ) | |
{ | |
v16 = node->left; | |
if ( !v16 ) | |
break; | |
v16->color = v16->color & 1 | (unsigned __int64)node; | |
} | |
this->lastProcMapNode = node; | |
if ( !node ) | |
return 0LL; | |
} | |
} | |
} | |
node = actor->_.baseProcMapNode.next; | |
if ( node ) | |
goto LABEL_25; | |
LABEL_11: | |
v9 = this->lastProcMapNode; | |
if ( !v9 ) | |
return 0LL; | |
v10 = v9->right; | |
if ( v10 ) | |
{ | |
v10->color = v10->color & 1 | (unsigned __int64)v9; | |
for ( node = v9->right; ; node = node->left ) | |
{ | |
v11 = node->left; | |
if ( !v11 ) | |
break; | |
v11->color = v11->color & 1 | (unsigned __int64)node; | |
} | |
this->lastProcMapNode = node; | |
if ( node ) | |
goto LABEL_25; | |
v6 = 0LL; | |
} | |
else | |
{ | |
while ( 1 ) | |
{ | |
node = (StringMapNode *)(v9->color & 0xFFFFFFFFFFFFFFFELL); | |
if ( !node ) | |
break; | |
v12 = node->left == v9; | |
v9 = (StringMapNode *)(v9->color & 0xFFFFFFFFFFFFFFFELL); | |
if ( v12 ) | |
{ | |
LABEL_24: | |
this->lastProcMapNode = node; | |
goto LABEL_25; | |
} | |
} | |
v6 = 0LL; | |
this->lastProcMapNode = 0LL; | |
} | |
return (Actor *)v6; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment