//
// GJBaseGameLayer::tryGetMainObject from 0x1001085f0 to 0x1001086b2 (194 bytes)
//
// 39 xrefs:
// > PlayLayer::activatePlatformerEndTrigger @ 0x100083d88
// > PlayLayer::processCheckpoints @ 0x100088844
// > GJBaseGameLayer::optimizeMoveGroups @ 0x1000f433f
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x1000f6008
// > GJBaseGameLayer::positionUIObjects @ 0x1000f8ab9
// > GJBaseGameLayer::positionUIObjects @ 0x1000f8b09
// > GJBaseGameLayer::tryGetObject @ 0x10010065a
// > GJBaseGameLayer::spawnParticleTrigger @ 0x100106640
// > GJBaseGameLayer::playKeyframeAnimation @ 0x10010855d
// > GJBaseGameLayer::getMoveTargetDelta @ 0x1001095cf
// > GJBaseGameLayer::getMoveTargetDelta @ 0x100109661
// > GJBaseGameLayer::getSavedPosition @ 0x1001097ba
// > GJBaseGameLayer::getSavedPosition @ 0x10010981c
// > GJBaseGameLayer::triggerTransformCommand @ 0x100116491
// > GJBaseGameLayer::updateGradientLayers @ 0x1001174ce
// > GJBaseGameLayer::updateGradientLayers @ 0x1001174e1
// > GJBaseGameLayer::updateGradientLayers @ 0x1001174f4
// > GJBaseGameLayer::updateGradientLayers @ 0x100117507
// > GJBaseGameLayer::positionForShaderTarget @ 0x1001199c5
// > GJBaseGameLayer::speedForShaderTarget @ 0x100119aa1
// > GJBaseGameLayer::processAreaEffects @ 0x10011f0a7
// > GJBaseGameLayer::processTransformActions @ 0x1001233be
// > GJBaseGameLayer::processRotationActions @ 0x1001241fb
// > GJBaseGameLayer::processFollowActions @ 0x10012507c
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x1001278b5
// > sub_10012CFB0 @ 0x10012d01b
// > GJBaseGameLayer::updateCamera @ 0x1001318c1
// > GJBaseGameLayer::updateCamera @ 0x10013192e
// > GJBaseGameLayer::updateCamera @ 0x100131996
// > GJBaseGameLayer::updateCamera @ 0x100131a3d
// > GJBaseGameLayer::updateCamera @ 0x100131ab5
// > GJBaseGameLayer::updateCamera @ 0x100132633
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10013b667
// > GJBaseGameLayer::volumeForProximityEffect @ 0x10013e4b0
// > GJBaseGameLayer::visit @ 0x1001440d5
// > GJBaseGameLayer::visit @ 0x1001440e7
// > GJBaseGameLayer::visit @ 0x1001440fd
// > GJBaseGameLayer::visit @ 0x100144110
// > EditorUI::findObject @ 0x1005b9a33
//
// 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:21:32 +0000
//
__int64 __fastcall GJBaseGameLayer::tryGetMainObject(_QWORD *a1, int a2)
{
__int64 v3; // rdi
__int64 v4; // rax
__int64 v5; // r15
__int64 result; // rax
__int64 v7; // r15
__int64 v8; // r14
if ( a2 <= 0 )
return 0;
v3 = a1[461];
v4 = cocos2d::CCDictionary::objectForKey_1(v3);
if ( !v4 || (v5 = v4, v3 = v4, !(unsigned int)sub_1007FEF90(v4)) || (v3 = v5, (result = sub_1007FEFE0(v5, 0)) == 0) )
{
v7 = 9999;
if ( (unsigned int)a2 < 0x270F )
v7 = (unsigned int)a2;
v8 = *(_QWORD *)(a1[452] + 8 * v7);
if ( v8
|| (v8 = sub_1007FE900(v3),
cocos2d::CCDictionary::setObject_1(a1[449], v8, v7),
(*(_QWORD *)(a1[452] + 8 * v7) = v8) != 0) )
{
if ( (unsigned int)sub_1007FEF90(v8) == 1 )
return sub_1007FEFE0(v8, 0);
}
return 0;
}
return result;
}