//
// GJBaseGameLayer::processPlayerFollowActions from 0x14022ded0 to 0x14022e27a (938 bytes)
//
// 5 xrefs:
// > GJBaseGameLayer::processMoveActionsStep @ 0x14022b72e
// > ??> @ 0x140680b90
// > ??> @ 0x140680ba0
// > ??> @ 0x1406cdcf8
// > ??> @ 0x1406cdd04
//
// 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)
{
GJEffectManager *m_effectManager; // rax
float v4; // xmm1_4
std::_Vector_val>::pointer Mylast; // rbp
_QWORD *Myfirst; // r13
double v7; // xmm12_8
__int64 v8; // r14
int v9; // eax
__int64 v10; // rcx
__int64 v11; // rbx
std::_Simple_types::value_type v12; // r15
double v13; // xmm1_8
float v14; // xmm9_4
float v15; // xmm7_4
cocos2d::ccArray *data; // rdi
__int64 num; // rax
cocos2d::CCObject **arr; // rdi
cocos2d::CCObject **v19; // r12
cocos2d::CCObject *v20; // rbx
float v21; // xmm1_4
PlayerObject *m_player1; // rbp
float v23; // xmm0_4
float y; // xmm6_4
int v25; // r8d
int v26; // ecx
int v27; // eax
float v28; // xmm6_4
float v29; // xmm6_4
char v30[16]; // [rsp+20h] [rbp-D8h] BYREF
cocos2d::CCArray *v31; // [rsp+100h] [rbp+8h]
_QWORD *v32; // [rsp+110h] [rbp+18h]
std::_Simple_types::value_type *v33; // [rsp+118h] [rbp+20h]
m_effectManager = a1->m_effectManager;
v4 = a2 * 60.0;
Mylast = m_effectManager->m_unkVector6f0._Mypair._Myval2._Mylast;
Myfirst = m_effectManager->m_unkVector6f0._Mypair._Myval2._Myfirst;
v33 = Mylast;
v32 = Myfirst;
if ( Myfirst != Mylast )
{
v7 = v4;
do
{
v8 = *Myfirst;
v9 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)*Myfirst + 56LL))(*Myfirst);
if ( v9 > 9999 )
v9 = 9999;
if ( v9 < 0 )
v9 = 0;
v11 = (unsigned int)v9;
v12 = a1->m_groups._Mypair._Myval2._Myfirst[v9];
v31 = v12;
if ( !v12 )
{
v31 = (cocos2d::CCArray *)cocos2d::CCArray::create(v10);
v12 = v31;
cocos2d::CCDictionary::setObject(a1->m_groupDict, v31, (unsigned int)v11);
a1->m_groups._Mypair._Myval2._Myfirst[v11] = v31;
}
v13 = fmin(1.0, v7 * *(double *)(v8 + 168));
if ( v13 < 0.0 )
v13 = 0.0;
v14 = v13;
v15 = v7 * *(double *)(v8 + 192);
if ( v12 )
{
data = v12->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
v19 = &arr[num - 1];
if ( arr <= v19 )
{
do
{
v20 = *arr;
if ( !*arr )
break;
if ( !BYTE2(v20[23].m_uID) && v20[22].m_nLuaID != a1->m_gameState.m_commandIndex )
{
v21 = *(double *)&v20[17].m_uID;
*(float *)&v20[22].__vftable = *(double *)&v20[17].__vftable;
*((float *)&v20[22].__vftable + 1) = v21;
v20[22].m_nLuaID = a1->m_gameState.m_commandIndex;
LOWORD(v20[15].m_uIndexInArray) = 257;
}
m_player1 = a1->m_player1;
v23 = *(double *)(v8 + 176);
if ( v23 > 0.0 )
{
v25 = (int)floorf(v23 / 0.0099999998);
if ( v25 > 199 )
v25 = 199;
if ( v25 < 0 )
v25 = 0;
v26 = m_player1->m_followRelated % 200 - v25;
v27 = v26 + 200;
if ( v26 >= 0 )
v27 = m_player1->m_followRelated % 200 - v25;
y = m_player1->m_playerFollowFloats._Mypair._Myval2._Myfirst[v27];
}
else
{
y = m_player1->m_obPosition.y;
}
if ( y != 0.0 )
{
v28 = y + (float)*(int *)(v8 + 184);
v29 = (float)(v28
- *(float *)(((__int64 (__fastcall *)(cocos2d::CCObject *, char *))v20->__vftable[16].encodeWithCoder)(
v20,
v30)
+ 4))
* v14;
if ( v29 != 0.0 )
{
if ( v15 > 0.0 )
{
if ( v29 <= v15 )
v29 = fmaxf(-v15, v29);
else
v29 = v15;
}
*(_WORD *)((char *)&v20[15].m_uID + 1) = 257;
*(double *)&v20[17].m_uID = v29 + *(double *)&v20[17].m_uID;
}
}
++arr;
}
while ( arr <= v19 );
v12 = v31;
Myfirst = v32;
Mylast = v33;
}
}
}
a1->updateDisabledObjectsLastPos(a1, v12);
v32 = ++Myfirst;
}
while ( Myfirst != Mylast );
}
}