//
// GJBaseGameLayer::tryGetGroupParent from 0x85d8d8 to 0x85d980 (168 bytes)
//
// 1 xrefs:
// > ??> @ 0xbfec8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
GameObject *GJBaseGameLayer::tryGetGroupParent(GJBaseGameLayer *a1, int a2)
{
GameObject *v4; // x19
cocos2d::CCArray *Group; // x0
cocos2d::ccArray *data; // x0
unsigned int num; // w1
GameObject **arr; // x0
GameObject **v10; // x3
GameObject *v11; // x1
v4 = (GameObject *)cocos2d::CCDictionary::objectForKey(a1->m_parentGroupsDict, a2);
if ( !v4 )
{
Group = GJBaseGameLayer::getGroup(a1, a2);
if ( Group )
{
data = Group->data;
num = data->num;
if ( data->num )
{
arr = (GameObject **)data->arr;
v10 = &arr[num - 1];
if ( arr <= v10 )
{
v11 = *arr;
if ( *arr )
{
while ( !v11->m_hasGroupParent )
{
if ( v10 < ++arr )
return v4;
v11 = *arr;
if ( !*arr )
return nullptr;
}
return v11;
}
}
}
}
}
return v4;
}