//
// GJBaseGameLayer::processFollowActions from 0x863b48 to 0x863de8 (672 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processMoveActionsStep @ 0x89d278
// > ??> @ 0xacba8
//
// 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 GJBaseGameLayer::processFollowActions(GJBaseGameLayer *a1)
{
GJEffectManager *m_effectManager; // x0
CCMoveCNode **m_start; // x22
CCMoveCNode **m_finish; // x27
CCMoveCNode *v5; // x28
int v6; // w0
cocos2d::CCArray *Group; // x23
GameObject *MainObject; // x0
GameObject *v9; // x19
unsigned int m_commandIndex; // w1
double m_positionX; // d1
float m_positionY; // s0
double v13; // d1
double v14; // d0
_BOOL4 v15; // w24
_BOOL4 v16; // w25
GroupCommandObject2 *m_groupObject; // x0
double v18; // d0
GJEffectManager *v19; // x19
int v20; // w0
cocos2d::ccArray *data; // x0
cocos2d::CCObject **arr; // x21
cocos2d::CCObject **v23; // x26
cocos2d::CCObject *v24; // x19
unsigned int v25; // w0
double v26; // d1
int v27; // s0
GJEffectManager *v28; // x19
int v29; // w0
m_effectManager = a1->m_effectManager;
m_start = m_effectManager->m_unkVector6d8.m_start;
m_finish = m_effectManager->m_unkVector6d8.m_finish;
while ( m_finish != m_start )
{
while ( 1 )
{
v5 = *m_start;
v6 = (*m_start)->getTag(*m_start);
Group = GJBaseGameLayer::getGroup(a1, v6);
MainObject = GJBaseGameLayer::tryGetMainObject(a1, v5->m_unk074);
v9 = MainObject;
if ( MainObject )
{
m_commandIndex = a1->m_gameState.m_commandIndex;
if ( MainObject->m_unk4C4 != m_commandIndex )
{
m_positionX = MainObject->m_positionX;
MainObject->m_unk4C4 = m_commandIndex;
*(float *)&m_positionX = m_positionX;
m_positionY = MainObject->m_positionY;
MainObject->m_lastPosition.x = *(float *)&m_positionX;
MainObject->m_lastPosition.y = m_positionY;
GameObject::dirtifyObjectRect(MainObject);
}
v13 = (v9->m_positionX - v9->m_lastPosition.x) * v5->m_unk080;
v14 = (v9->m_positionY - v9->m_lastPosition.y) * v5->m_unk088;
v5->m_unk038 = v13;
v5->m_unk040 = v14;
v15 = v13 != 0.0;
v16 = v14 != 0.0;
if ( v16 || v15 )
break;
if ( v5->m_unk078 )
break;
if ( v9->m_unk4fb )
{
v28 = a1->m_effectManager;
v29 = v5->getTag(v5);
if ( GJEffectManager::wasFollowing(v28, v29, v5->m_unk074) )
break;
}
}
if ( m_finish == ++m_start )
return;
}
m_groupObject = v5->m_groupObject;
if ( m_groupObject )
{
v18 = m_groupObject->m_currentYOffset + v5->m_unk040;
m_groupObject->m_currentXOffset = m_groupObject->m_currentXOffset + v5->m_unk038;
m_groupObject->m_currentYOffset = v18;
}
v19 = a1->m_effectManager;
v20 = v5->getTag(v5);
GJEffectManager::setFollowing(v19, v20, v5->m_unk074, v16 || v15);
a1->m_followedCount += cocos2d::CCArray::count(Group);
if ( Group )
{
data = Group->data;
if ( data->num )
{
arr = data->arr;
v23 = &arr[data->num - 1];
while ( v23 >= arr )
{
v24 = *arr;
if ( !*arr )
break;
if ( !BYTE2(v24[22].m_unknown2) )
{
v25 = a1->m_gameState.m_commandIndex;
if ( v24[21].m_nZOrder != v25 )
{
v26 = *(double *)&v24[16].m_uIndexInArray;
v24[21].m_nZOrder = v25;
*(float *)&v26 = v26;
*(float *)&v27 = *(double *)&v24[16].m_unknown2;
v24[21].m_uIndexInArray = LODWORD(v26);
v24[21].m_uUnknown = v27;
GameObject::dirtifyObjectRect((GameObject *)v24);
}
}
if ( v16 )
*(double *)&v24[16].m_unknown2 = *(double *)&v24[16].m_unknown2 + v5->m_unk040;
GameObject::dirtifyObjectPos((GameObject *)v24);
if ( v15 && !LOBYTE(v24[12].m_uUnknown) )
*(double *)&v24[16].m_uIndexInArray = *(double *)&v24[16].m_uIndexInArray + v5->m_unk038;
++arr;
a1->updateObjectSection(a1, (GameObject *)v24);
}
}
}
++m_start;
a1->updateDisabledObjectsLastPos(a1, Group);
}
}