//
// GJBaseGameLayer::assignNewStickyGroups from 0x8608ec to 0x860a10 (292 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::duplicateKeyframeAnimation @ 0x671cf0
// > EditorUI::pasteObjects @ 0x6bf7d0
// > ??> @ 0x77e98
//
// 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 GJBaseGameLayer::assignNewStickyGroups(GJBaseGameLayer *a1, cocos2d::CCArray *a2)
{
unsigned int v4; // w19
cocos2d::CCDictionary *v5; // x24
bool v6; // cf
unsigned int v7; // w1
cocos2d::CCArray *v8; // x0
__int64 v9; // x0
int v10; // w1
cocos2d::CCObject *v11; // x20
cocos2d::CCArray *v12; // x0
cocos2d::CCArray *v13; // x22
cocos2d::CCDictElement *m_pElements; // x0
cocos2d::CCDictElement *i; // x19
cocos2d::CCArray *m_pObject; // x20
if ( a2 )
{
v4 = 0;
v5 = nullptr;
LABEL_3:
v6 = v4 >= (unsigned int)cocos2d::CCArray::count(a2);
v7 = v4;
v8 = a2;
++v4;
for ( ; !v6; ++v4 )
{
v9 = cocos2d::CCArray::objectAtIndex(v8, v7);
v10 = *(_DWORD *)(v9 + 856);
v11 = (cocos2d::CCObject *)v9;
if ( v10 <= 0 )
goto LABEL_3;
if ( v5 )
{
v12 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v5, v10);
v13 = v12;
if ( !v12 )
goto LABEL_16;
}
else
{
v5 = cocos2d::CCDictionary::create();
v12 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v5, v11[15].m_nTag);
v13 = v12;
if ( !v12 )
{
LABEL_16:
v13 = (cocos2d::CCArray *)cocos2d::CCArray::create(v12);
cocos2d::CCDictionary::setObject(v5, v13, v11[15].m_nTag);
}
}
cocos2d::CCArray::addObject(v13, v11);
v6 = v4 >= (unsigned int)cocos2d::CCArray::count(a2);
v7 = v4;
v8 = a2;
}
if ( v5 )
{
m_pElements = v5->m_pElements;
if ( m_pElements )
{
for ( i = (cocos2d::CCDictElement *)m_pElements->hh.next; ; i = (cocos2d::CCDictElement *)i->hh.next )
{
m_pObject = (cocos2d::CCArray *)m_pElements->m_pObject;
GJBaseGameLayer::ungroupStickyObjects(a1, m_pObject);
GJBaseGameLayer::groupStickyObjects(a1, m_pObject);
m_pElements = i;
if ( !i )
break;
}
}
}
}
}