//
// GJBaseGameLayer::setGroupParent from 0x1001f284c to 0x1001f294c (256 bytes)
//
// 3 xrefs:
// > SetGroupIDLayer::onAddGroupParent @ 0x10003d548
// > GJBaseGameLayer::addToGroupParents @ 0x1001f2a6c
// > GJBaseGameLayer::loadGroupParentsFromString @ 0x1001f2d04
//
// 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
//
void __fastcall GJBaseGameLayer::setGroupParent(GJBaseGameLayer *a1, GameObject *a2, int a3)
{
GameObject *v6; // x0
cocos2d::CCObject *v7; // x22
__int64 v8; // x21
cocos2d::CCObject *v9; // x0
if ( a2 )
{
if ( a3 >= 1 )
{
v6 = (GameObject *)cocos2d::CCDictionary::objectForKey(a1->m_parentGroupsDict, (unsigned int)a3);
if ( v6 != a2 && (!v6 || !a1->m_keepGroupParents) )
{
GJBaseGameLayer::removeGroupParent(a1, a3);
cocos2d::CCDictionary::setObject(a1->m_parentGroupsDict, a2, (unsigned int)a3);
v7 = cocos2d::CCDictionary::objectForKey(a1->m_parentGroupIDs, (unsigned int)a2->m_uniqueID);
if ( !v7 )
{
v7 = (cocos2d::CCObject *)sub_10024A15C(0);
cocos2d::CCDictionary::setObject(a1->m_parentGroupIDs, v7, (unsigned int)a2->m_uniqueID);
}
if ( (unsigned int)sub_10024A36C(v7) )
{
v8 = 0;
while ( *(_DWORD *)(sub_10024A388(v7, v8) + 56) != a3 )
{
v8 = (unsigned int)(v8 + 1);
if ( (unsigned int)v8 >= (unsigned int)sub_10024A36C(v7) )
goto LABEL_12;
}
}
else
{
LABEL_12:
v9 = sub_10011C030(a3);
sub_10024A2D0(v7, v9);
}
a2->m_hasGroupParentsString = 1;
}
}
}
}