//
// PlayLayer::processCheckpoints from 0x31f16c to 0x31f2d6 (362 bytes)
//
// 0 xrefs:
//
// 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::processCheckpoints(PlayLayer *a1)
{
GameManager *v2; // r0
CheckpointObject *v3; // r5
CheckpointGameObject *m_activatedCheckpoint; // r3
cocos2d::CCPoint *v5; // r1
int m_centerGroupID; // r1
GameObject *MainObject; // r0
GameObject *Object; // r9
void (__fastcall *setStartPos)(GameObject *__hidden, cocos2d::CCPoint); // r10
PlayerCheckpoint *m_player1Checkpoint; // r9
GameObject *v11; // r0
CheckpointGameObject *v12; // r3
void (__fastcall *spawnGroup)(GJBaseGameLayer *__hidden, int, bool, double, const std::vector *, int, int); // r6
cocos2d::CCPoint v14; // [sp+18h] [bp-1Ch] BYREF
cocos2d::CCPoint v15; // [sp+20h] [bp-14h] BYREF
int v16; // [sp+28h] [bp-Ch]
if ( a1->m_tryPlaceCheckpoint )
{
a1->m_tryPlaceCheckpoint = 0;
PlayLayer::markCheckpoint(a1);
}
if ( a1->m_activatedCheckpoint )
{
v2 = GameManager::sharedState();
if ( GameManager::getGameVariable(v2, "0146") || (v3 = PlayLayer::markCheckpoint(a1)) == nullptr )
{
LABEL_13:
if ( a1->m_activatedCheckpoint->m_targetGroupID > 0 )
{
spawnGroup = a1->spawnGroup;
v15.x = 0.0;
v15.y = 0.0;
v16 = 0;
((void (__fastcall *)(PlayLayer *))spawnGroup)(a1);
std::_Vector_base::~_Vector_base((void **)&v15);
}
GJBaseGameLayer::gameEventTriggered(a1, Checkpoint, 0, 0);
a1->m_activatedCheckpoint = nullptr;
return;
}
((void (__fastcall *)(cocos2d::CCPoint *))a1->m_activatedCheckpoint->getRealPosition)(&v14);
m_activatedCheckpoint = a1->m_activatedCheckpoint;
if ( m_activatedCheckpoint->m_targetPlayer1 )
{
v5 = (cocos2d::CCPoint *)a1->m_player1->getPosition(a1->m_player1);
}
else
{
m_centerGroupID = m_activatedCheckpoint->m_centerGroupID;
if ( m_centerGroupID <= 0 )
goto LABEL_12;
MainObject = GJBaseGameLayer::tryGetMainObject(a1, m_centerGroupID);
if ( !MainObject )
goto LABEL_12;
MainObject->getRealPosition(&v15, MainObject);
v5 = &v15;
}
cocos2d::CCPoint::operator=(&v14, v5);
LABEL_12:
Object = CheckpointObject::getObject(v3);
setStartPos = Object->setStartPos;
cocos2d::CCPoint::CCPoint(&v15, &v14);
((void (__fastcall *)(GameObject *, cocos2d::CCPoint *))setStartPos)(Object, &v15);
m_player1Checkpoint = v3->m_player1Checkpoint;
cocos2d::CCPoint::CCPoint(&v15, &v14);
cocos2d::CCPoint::operator=(&m_player1Checkpoint->m_position, &v15);
v3->m_player1Checkpoint->m_platformerCheckpoint = 1;
v11 = CheckpointObject::getObject(v3);
GameObject::makeInvisible(v11);
v12 = a1->m_activatedCheckpoint;
v3->m_uniqueID = v12->m_uniqueID;
v3->m_respawnID = v12->m_respawnID;
goto LABEL_13;
}
}