//
// PlayLayer::removeCheckpoint from 0x31495a to 0x3149e8 (142 bytes)
//
// 4 xrefs:
// > UILayer::onDeleteCheck @ 0x30cb20
// > PlayLayer::removeAllCheckpoints @ 0x3149fe
// > PlayLayer::storeCheckpoint @ 0x314a3a
// > PlayerObject::removePlacedCheckpoint @ 0x33de98
//
// 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
//
void PlayLayer::removeCheckpoint(PlayLayer *a1, bool a2)
{
_BOOL4 v3; // r6
cocos2d::CCArray *m_checkpointArray; // r0
CheckpointObject *Object; // r0
GameObject *v6; // r5
cocos2d::CCArray *v7; // r0
int v8; // r5
v3 = a2;
if ( cocos2d::CCArray::count(a1->m_checkpointArray) )
{
m_checkpointArray = a1->m_checkpointArray;
if ( v3 )
Object = (CheckpointObject *)cocos2d::CCArray::objectAtIndex(m_checkpointArray, 0);
else
Object = (CheckpointObject *)cocos2d::CCArray::lastObject(m_checkpointArray);
v6 = CheckpointObject::getObject(Object);
GJBaseGameLayer::removeObjectFromSection(a1, v6);
GameObject::removeGlow(v6);
v6->removeMeAndCleanup(v6);
v7 = a1->m_checkpointArray;
if ( v3 )
{
cocos2d::CCArray::removeObjectAtIndex(v7, 0, 1);
}
else
{
cocos2d::CCArray::removeLastObject(v7, 1);
if ( a1->m_isPlatformer && a1->m_isPracticeMode )
{
if ( cocos2d::CCArray::count(a1->m_checkpointArray) )
{
v8 = cocos2d::CCArray::lastObject(a1->m_checkpointArray);
GameObject::makeVisible(*(GameObject **)(v8 + 2576));
*(_DWORD *)(v8 + 3072) = a1->m_gameState.m_commandIndex;
}
}
}
}
}