//
// GJBaseGameLayer::processPlayerFollowActions from 0x474e34 to 0x474fe8 (436 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processMoveActionsStep @ 0x496cf8
//
// 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::processPlayerFollowActions(GJBaseGameLayer *a1, float a2)
{
float v3; // s19
GJEffectManager *m_effectManager; // r3
double **m_finish; // r10
double **m_start; // r8
double *v7; // r5
double *v8; // t1
int v9; // r0
cocos2d::CCArray *Group; // r0
double v11; // d6
cocos2d::CCArray *v12; // r9
float v13; // s17
cocos2d::ccArray *data; // r3
cocos2d::CCObject **arr; // r6
float v16; // s18
GameObject *v17; // r4
GameObject *v18; // t1
unsigned int m_commandIndex; // r1
float m_positionX; // s14
float m_positionY; // s14
float v22; // s15
float OldPosition; // s14
float v24; // s16
float v25; // s14
cocos2d::CCObject **v26; // [sp+0h] [bp-Ch]
float v27[2]; // [sp+Ch] [bp+0h] BYREF
v3 = a2 * 60.0;
m_effectManager = a1->m_effectManager;
m_finish = (double **)m_effectManager->m_unkVector6f0.m_finish;
m_start = (double **)m_effectManager->m_unkVector6f0.m_start;
while ( m_start != m_finish )
{
v8 = *m_start++;
v7 = v8;
v9 = (*(int (__fastcall **)(double *))(*(_DWORD *)v8 + 32))(v8);
Group = GJBaseGameLayer::getGroup(a1, v9);
v11 = v3 * v8[21];
v12 = Group;
if ( v11 >= 1.0 )
{
v13 = 1.0;
}
else if ( v11 > 0.0 )
{
v13 = v11;
}
else
{
v13 = 0.0;
}
if ( Group )
{
data = Group->data;
if ( data->num )
{
arr = data->arr;
v26 = &arr[data->num] + 0x3FFFFFFF;
v16 = v7[24] * v3;
while ( arr <= v26 )
{
v18 = (GameObject *)*arr++;
v17 = v18;
if ( !v18 )
break;
if ( !v17->m_isDecoration2 )
{
m_commandIndex = a1->m_gameState.m_commandIndex;
if ( v17->m_unk4C4 != m_commandIndex )
{
m_positionX = v17->m_positionX;
v17->m_lastPosition.x = m_positionX;
m_positionY = v17->m_positionY;
v17->m_lastPosition.y = m_positionY;
v17->m_unk4C4 = m_commandIndex;
GameObject::dirtifyObjectRect(v17);
}
}
v22 = v7[22];
OldPosition = PlayerObject::getOldPosition(a1->m_player1, v22);
if ( OldPosition != 0.0 )
{
v24 = OldPosition + (float)*((int *)v7 + 46);
v17->getRealPosition((cocos2d::CCPoint *)v27, v17);
v25 = (float)(v24 - v27[1]) * v13;
if ( v25 != 0.0 )
{
if ( v16 > 0.0 )
{
if ( v25 > v16 )
{
v25 = v16;
}
else if ( v25 < (float)-v16 )
{
v25 = -v16;
}
}
v17->m_positionY = v17->m_positionY + v25;
GameObject::dirtifyObjectPos(v17);
}
}
}
}
}
a1->updateDisabledObjectsLastPos(a1, v12);
}
}