//
// LevelCell::onClick from 0x10023ac60 to 0x10023ae91 (561 bytes)
//
// 6 xrefs:
// > LevelCell::loadLocalLevelCell @ 0x100236dce
// > LevelCell::loadCustomLevelCell @ 0x100237e0c
// > LevelCell::loadCustomLevelCell @ 0x100238073
// > LevelCell::loadCustomLevelCell @ 0x10023815d
// > LevelCell::loadCustomLevelCell @ 0x100238247
// > LevelCell::loadCustomLevelCell @ 0x100238313
//
// 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:27:16 +0000
//
__int64 __fastcall LevelCell::onClick(__int64 a1, __int64 a2, double a3)
{
__int64 result; // rax
__int64 (__fastcall ***v5)(_QWORD, __int64, __int64, __int64, _QWORD); // rdi
__int64 (__fastcall ***v6)(_QWORD, __int64, _QWORD, __int64, _QWORD); // rdi
__int64 v7; // rcx
__int64 v8; // rbx
int v9; // r15d
__int64 v10; // rax
__int64 v11; // r14
_DWORD *v12; // r15
int v13; // ebx
int v14; // eax
_QWORD v15[2]; // [rsp+0h] [rbp-30h] BYREF
void *__p; // [rsp+10h] [rbp-20h]
if ( *(_BYTE *)(a1 + 568) == 1 )
{
result = *(_QWORD *)(a1 + 416);
v5 = *(__int64 (__fastcall ****)(_QWORD, __int64, __int64, __int64, _QWORD))(result + 632);
if ( v5 )
return (**v5)(v5, a1, 37, 1, 0);
return result;
}
if ( *(_DWORD *)(a1 + 544) == 29 && (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) )
{
result = (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) - 1;
if ( (unsigned int)result <= 3 )
{
v6 = *(__int64 (__fastcall ****)(_QWORD, __int64, _QWORD, __int64, _QWORD))(*(_QWORD *)(a1 + 416) + 632LL);
if ( v6 )
{
v7 = dword_100A064D0[(unsigned int)result];
return (**v6)(v6, a1, *(unsigned int *)(a1 + 544), v7, 0);
}
}
}
else if ( *(int *)(*(_QWORD *)(a1 + 560) + 792LL) < 23 )
{
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) == 5
|| (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) == 6 )
{
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
v6 = *(__int64 (__fastcall ****)(_QWORD, __int64, _QWORD, __int64, _QWORD))(*(_QWORD *)(a1 + 416) + 632LL);
if ( !v6 )
return result;
v7 = (unsigned int)((_DWORD)result != 5) + 9;
return (**v6)(v6, a1, *(unsigned int *)(a1 + 544), v7, 0);
}
v9 = *(_DWORD *)(*(_QWORD *)(a1 + 560) + 1292LL);
v10 = GameLevelManager::sharedState(a3);
v11 = v10;
if ( v9 <= 0 )
{
return GameLevelManager::gotoLevelPage(v10, *(_QWORD *)(a1 + 560));
}
else
{
v12 = (_DWORD *)GJGameLevel::duplicate(*(_QWORD *)(a1 + 560));
v13 = *(_DWORD *)(*(_QWORD *)(a1 + 560) + 1292LL);
v12[232] = v13;
v14 = (int)(float)((float)((float)rand() * 4.6566129e-10) * 1000.0);
v12[231] = v14;
v12[230] = v14 + v13;
return GameLevelManager::gotoLevelPage(v11, v12);
}
}
else
{
__p = operator new(0x38u);
v15[0] = 57;
v15[1] = 54;
strcpy((char *)__p, "Please update your application to download this level.");
v8 = sub_100493AB0(0, "Unavailable", v15, "Close", 0);
if ( (v15[0] & 1) != 0 )
operator delete(__p);
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 1312LL))(v8);
}
return result;
}