//
// GameObject::addToGroup from 0x44db62 to 0x44dbb6 (84 bytes)
//
// 2 xrefs:
// > TeleportPortalObject::addToGroup2 @ 0x4e6512
// > TeleportPortalObject::addToGroup @ 0x4e6b14
//
// 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:48:35 +0000
//
int __fastcall GameObject::addToGroup(GameObject *this, int a2)
{
int v4; // r1
int i; // r3
int v6; // r2
if ( *((__int16 *)this + 510) > 9 || (unsigned int)(a2 - 1) > 0x270E )
return 0;
GameObject::createGroupContainer((int)this, 0xAu);
v4 = *((__int16 *)this + 510);
for ( i = 0; ; ++i )
{
v6 = *((_DWORD *)this + 254);
if ( i >= v4 )
{
*(_WORD *)(v6 + 2 * v4) = a2;
++*((_WORD *)this + 510);
return 1;
}
if ( *(__int16 *)(v6 + 2 * i) == a2 )
break;
}
return -1;
}