//
// SetGroupIDLayer::onZLayerShift from 0x100300130 to 0x1003001e2 (178 bytes)
//
// 2 xrefs:
// > SetGroupIDLayer::init @ 0x1002fe006
// > SetGroupIDLayer::init @ 0x1002fe19d
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:28:32 +0000
//
__int64 __fastcall SetGroupIDLayer::onZLayerShift(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v4; // rdi
int v5; // r14d
int v6; // r12d
unsigned int v7; // r14d
__int64 v8; // r15
int v9; // eax
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
v4 = *(_QWORD *)(a1 + 680);
if ( v4 )
{
v5 = result;
result = sub_1007FEF90(v4);
if ( (_DWORD)result )
{
v6 = 4 * (v5 == 1) - 2;
v7 = 0;
do
{
v8 = sub_1007FEFE0(*(_QWORD *)(a1 + 680), v7);
v9 = v6 + GameObject::getObjectZLayer(v8);
if ( v9 >= 11 )
v9 = 11;
if ( v9 < -4 )
v9 = -5;
GameObject::setCustomZLayer(v8, (unsigned int)v9);
*(_BYTE *)(v8 + 1148) = 1;
++v7;
result = sub_1007FEF90(*(_QWORD *)(a1 + 680));
}
while ( v7 < (unsigned int)result );
}
}
return result;
}