//
// GJBaseGameLayer::getMoveTargetDelta from 0x10012b940 to 0x10012bbac (620 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::triggerMoveCommand @ 0x100137a0b
//
// 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
//
// local variable allocation has failed, the output may be wrong!
cocos2d::CCPoint __fastcall GJBaseGameLayer::getMoveTargetDelta(GJBaseGameLayer *a1, EffectGameObject *a2, bool a3)
{
char v3; // cl
char v4; // r12
__int64 v5; // r13
int v7; // ebx
cocos2d::CCDictionary *v8; // rdi
__int64 v9; // rsi
GameObject *Object; // r15
intptr_t v11; // r15
cocos2d::CCObject *v12; // rbx
cocos2d::CCObject *v13; // rsi
int v14; // ebx
cocos2d::CCDictionary *v15; // rdi
intptr_t v16; // r12
cocos2d::CCObject *v17; // rbx
GameObject *v18; // rax
_BYTE v20[8]; // [rsp+0h] [rbp-40h] BYREF
_BYTE v21[8]; // [rsp+8h] [rbp-38h] BYREF
GJBaseGameLayer *v22; // [rsp+10h] [rbp-30h]
cocos2d::CCPoint result; // 0:xmm0_8.8
v4 = v3;
v5 = a3;
v22 = a1;
v7 = *(_DWORD *)(a3 + 1528LL);
if ( v7 <= 0 )
{
v7 = *(_DWORD *)(a3 + 1464LL);
if ( v3 )
goto LABEL_3;
LABEL_8:
Object = GJBaseGameLayer::tryGetObject((GJBaseGameLayer *)a2, v7);
if ( *(_BYTE *)(v5 + 1684) )
goto LABEL_33;
goto LABEL_18;
}
if ( !v3 )
goto LABEL_8;
LABEL_3:
if ( v7 <= 0 )
goto LABEL_17;
v8 = *(cocos2d::CCDictionary **)&a2[1].m_unk708;
v9 = (unsigned int)v7;
Object = (GameObject *)cocos2d::CCDictionary::objectForKey(v8, (unsigned int)v7);
if ( Object )
{
if ( *(_BYTE *)(v5 + 1684) )
goto LABEL_33;
goto LABEL_18;
}
v11 = 9999;
if ( (unsigned int)v7 < 0x270F )
v11 = (unsigned int)v7;
v12 = *(cocos2d::CCObject **)(*(_QWORD *)&a2[1].m_zoomValue + 8 * v11);
if ( v12
|| (v12 = (cocos2d::CCObject *)sub_10071F9E0(v8, v9),
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)&a2[1].m_unk6a8, v12, v11),
(*(_QWORD *)(*(_QWORD *)&a2[1].m_zoomValue + 8 * v11) = v12) != 0) )
{
if ( (unsigned int)sub_100720070(v12) == 1 )
{
Object = (GameObject *)sub_1007200C0(v12, 0);
if ( *(_BYTE *)(v5 + 1684) )
goto LABEL_33;
}
else
{
Object = nullptr;
if ( *(_BYTE *)(v5 + 1684) )
goto LABEL_33;
}
}
else
{
LABEL_17:
Object = nullptr;
if ( *(_BYTE *)(v5 + 1684) )
goto LABEL_33;
}
LABEL_18:
if ( *(_BYTE *)(v5 + 1685) == 1 )
{
if ( LOBYTE(a2->m_exitType) )
{
v13 = *(cocos2d::CCObject **)&a2[1].m_rotationDelta;
goto LABEL_34;
}
LABEL_33:
v13 = *(cocos2d::CCObject **)&a2[1].m_rotationSpeed;
goto LABEL_34;
}
v14 = *(_DWORD *)(v5 + 1468);
if ( !v4 )
{
v18 = GJBaseGameLayer::tryGetObject((GJBaseGameLayer *)a2, v14);
LABEL_31:
v13 = v18;
goto LABEL_34;
}
if ( v14 <= 0 )
{
LABEL_37:
*(double *)&result = sub_10028CC60(v22);
return result;
}
v15 = *(cocos2d::CCDictionary **)&a2[1].m_unk708;
v13 = cocos2d::CCDictionary::objectForKey(v15, *(unsigned int *)(v5 + 1468));
if ( !v13 )
{
v16 = 9999;
if ( (unsigned int)v14 < 0x270F )
v16 = (unsigned int)v14;
v17 = *(cocos2d::CCObject **)(*(_QWORD *)&a2[1].m_zoomValue + 8 * v16);
if ( !v17 )
{
v17 = (cocos2d::CCObject *)sub_10071F9E0(v15, 0);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)&a2[1].m_unk6a8, v17, v16);
*(_QWORD *)(*(_QWORD *)&a2[1].m_zoomValue + 8 * v16) = v17;
if ( !v17 )
goto LABEL_37;
}
if ( (unsigned int)sub_100720070(v17) != 1 )
goto LABEL_37;
v18 = (GameObject *)sub_1007200C0(v17, 0);
goto LABEL_31;
}
LABEL_34:
if ( !Object || !v13 || Object->m_uniqueID == v13[16].m_uReference )
goto LABEL_37;
((void (__fastcall *)(_BYTE *))v13->__vftable[16].getTag)(v20);
((void (__fastcall *)(_BYTE *, GameObject *))Object->getRealPosition)(v21, Object);
sub_10028CD00(v22, v20, v21);
return result;
}