//
// GJBaseGameLayer::addToGroups from 0x59076c to 0x5907a6 (58 bytes)
//
// 4 xrefs:
// > PlayLayer::addObject @ 0x40030a
// > PlayLayer::addObject @ 0x400728
// > PlayLayer::addObject @ 0x400970
// > LevelEditorLayer::addSpecial @ 0x46e652
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:53:05 +0000
//
int __fastcall GJBaseGameLayer::addToGroups(int this, GameObject *a2, int a3)
{
int v3; // r6
signed int i; // r4
int GroupID; // r0
v3 = this;
if ( *((__int16 *)a2 + 510) > 0 )
{
for ( i = 0; i < *((__int16 *)a2 + 510); ++i )
{
GroupID = GameObject::getGroupID(a2, i);
this = (*(int (__fastcall **)(int, GameObject *, int, int))(*(_DWORD *)v3 + 676))(v3, a2, GroupID, a3);
}
}
return this;
}