//
// PlayLayer::removeCheckpoint from 0x10008ad30 to 0x10008ae19 (233 bytes)
//
// 3 xrefs:
// > PlayLayer::removeAllCheckpoints @ 0x10008b835
// > PlayerObject::removePlacedCheckpoint @ 0x100400b20
// > UILayer::onDeleteCheck @ 0x1004c2897
//
// 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:20:06 +0000
//
__int64 __fastcall PlayLayer::removeCheckpoint(__int64 a1, char a2)
{
__int64 result; // rax
__int64 v5; // rdi
__int64 v6; // rax
__int64 v7; // rsi
__int64 v8; // rdi
__int64 v9; // r14
result = sub_1007FEF90(*(_QWORD *)(a1 + 14248));
if ( (_DWORD)result )
{
v5 = *(_QWORD *)(a1 + 14248);
if ( a2 )
v6 = sub_1007FEFE0(v5, 0);
else
v6 = sub_1007FF000(v5);
v7 = sub_1005DDE90(v6);
GJBaseGameLayer::removeObjectFromSection(a1, v7);
GameObject::removeGlow(v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v7 + 536LL))(v7);
v8 = *(_QWORD *)(a1 + 14248);
if ( a2 )
{
return sub_1007FF150(v8, 0, 1);
}
else
{
result = sub_1007FF120(v8, 1);
if ( *(_BYTE *)(a1 + 12238) == 1 && *(_BYTE *)(a1 + 12544) == 1 )
{
result = sub_1007FEF90(*(_QWORD *)(a1 + 14248));
if ( (_DWORD)result )
{
v9 = sub_1007FF000(*(_QWORD *)(a1 + 14248));
GameObject::makeVisible(*(_QWORD *)(v9 + 3112));
result = *(unsigned int *)(a1 + 944);
*(_DWORD *)(v9 + 3872) = result;
}
}
}
}
return result;
}