//
// EditLevelLayer::onClone from 0x1001e0f60 to 0x1001e1076 (278 bytes)
//
// 1 xrefs:
// > EditLevelLayer::FLAlert_Clicked @ 0x1001e0cf0
//
// 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:26:28 +0000
//
__int64 __fastcall EditLevelLayer::onClone(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // rdx
__m128 v4; // xmm0
__int64 v5; // rax
__int64 v6; // rax
_DWORD *NewLevel; // r14
__int64 v8; // rsi
int v9; // ebx
__int64 v10; // rbx
__int64 v11; // r15
char *v12; // rax
char *v13; // rax
result = cocos2d::CCDirector::sharedDirector(a1, a2);
if ( !*(_BYTE *)(result + 176) && !*(_BYTE *)(a1 + 496) )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1072LL))(a1, 0);
*(_BYTE *)(a1 + 496) = 1;
v4 = GameManager::sharedState(a1, 0, v3);
*(_DWORD *)(v5 + 708) = 2;
v6 = GameLevelManager::sharedState(*(double *)v4.i64);
NewLevel = (_DWORD *)GameLevelManager::createNewLevel(v6);
v8 = *(_QWORD *)(a1 + 472);
*(double *)v4.i64 = GJGameLevel::copyLevelInfo(NewLevel, v8);
EditLevelLayer::verifyLevelName(a1, v4);
v9 = *(_DWORD *)(*(_QWORD *)(a1 + 472) + 988LL) - *(_DWORD *)(*(_QWORD *)(a1 + 472) + 992LL);
NewLevel[249] = v9;
v4.f32[0] = (float)((float)rand() * 4.6566129e-10) * 1000.0;
NewLevel[248] = (int)v4.f32[0];
NewLevel[247] = (int)v4.f32[0] + v9;
v10 = cocos2d::CCDirector::sharedDirector(a1, v8);
v11 = cocos2d::CCScene::create(a1);
*(_QWORD *)(AppDelegate::get(a1, v8) + 72) = v11;
v12 = EditLevelLayer::create((__int64)NewLevel);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v11 + 456LL))(v11, v12);
v13 = cocos2d::CCTransitionFade::create_1(v11, 0.5);
return cocos2d::CCDirector::replaceScene(v10, v13);
}
return result;
}