//
// GJBaseGameLayer::modifyGroupPhysics from 0x14022ee00 to 0x14022f0da (730 bytes)
//
// 6 xrefs:
// > GJBaseGameLayer::triggerAdvancedFollowEditCommand @ 0x14022ec4a
// > GJBaseGameLayer::triggerAdvancedFollowEditCommand @ 0x14022ec75
// > GJBaseGameLayer::triggerAdvancedFollowEditCommand @ 0x14022ecdf
// > ??> @ 0x140680d00
// > ??> @ 0x140680d68
// > ??> @ 0x1406cdde8
//
// 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::modifyGroupPhysics(GJBaseGameLayer *a1, AdvancedFollowEditObject *a2, cocos2d::CCArray *a3)
{
cocos2d::ccArray *data; // rsi
__int64 num; // rax
cocos2d::CCObject **arr; // rsi
cocos2d::CCObject **v8; // r14
cocos2d::CCObjectType m_eObjType; // r8d
std::_Hash, std::equal_to>, std::allocator>, false>>::_Mylist *p_List; // rax
std::_Vector_val>>>>>::pointer Myfirst; // rdx
std::_List_val>>::_Nodeptr Ptr; // rbx
unsigned __int64 v13; // rcx
unsigned __int64 v14; // rdx
float v15; // xmm0_4
float v16; // xmm1_4
unsigned __int64 v17; // rcx
int m_startSpeedReference; // r9d
__int64 v19; // r8
float v20; // [rsp+A0h] [rbp+18h] BYREF
float v21; // [rsp+A4h] [rbp+1Ch]
if ( a3 )
{
data = a3->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
v8 = &arr[num - 1];
if ( arr <= v8 )
{
while ( 1 )
{
if ( !*arr )
return;
m_eObjType = (*arr)[16].m_eObjType;
p_List = &a1->m_gameState.m_gameObjectPhysics._List;
Myfirst = a1->m_gameState.m_gameObjectPhysics._Vec._Mypair._Myval2._Myfirst;
Ptr = Myfirst[2
* ((0x100000001B3LL
* (((unsigned __int64)(unsigned int)m_eObjType >> 24)
^ (0x100000001B3LL
* (BYTE2(m_eObjType)
^ (0x100000001B3LL
* ((0x100000001B3LL * ((unsigned __int8)m_eObjType ^ 0xCBF29CE484222325uLL))
^ BYTE1(m_eObjType)))))))
& a1->m_gameState.m_gameObjectPhysics._Mask)
+ 1]._Ptr;
if ( Ptr == a1->m_gameState.m_gameObjectPhysics._List._Mypair._Myval2._Myhead )
goto LABEL_11;
if ( m_eObjType != *((_DWORD *)Ptr + 4) )
break;
LABEL_12:
if ( !Ptr )
Ptr = a1->m_gameState.m_gameObjectPhysics._List._Mypair._Myval2._Myhead;
if ( Ptr != p_List->_Mypair._Myval2._Myhead )
{
v13 = 214013 * qword_1406C2E90 + 2531011;
v14 = 214013 * v13 + 2531011;
v15 = (float)((float)((float)((float)((v13 >> 16) & 0x7FFF) / 32767.0) * a2->m_modXVariance) + a2->m_modX)
* *((float *)Ptr + 8);
v16 = (float)((float)((float)((float)((v14 >> 16) & 0x7FFF) / 32767.0) * a2->m_modYVariance) + a2->m_modY)
* *((float *)Ptr + 9);
v17 = 214013 * v14 + 2531011;
qword_1406C2E90 = v17;
*((float *)Ptr + 8) = v15;
*((float *)Ptr + 9) = v16;
if ( (float)((float)((float)((float)((v17 >> 16) & 0x7FFF) / 32767.0) * a2->m_startSpeedVariance)
+ a2->m_startSpeed) != 0.0 )
{
m_startSpeedReference = a2->m_startSpeedReference;
v19 = *((_QWORD *)Ptr + 3);
qword_1406C2E90 = 214013 * v17 + 2531011;
GJBaseGameLayer::getFollowSpeedVal(
a1,
(GameObject *)&v20,
v19,
m_startSpeedReference,
*(float *)&a2->m_startDirectionReference,
(float)((float)((float)(((214013 * v17 + 2531011) >> 16) & 0x7FFF) / 32767.0)
* a2->m_startDirectionVariance)
+ a2->m_startDirection);
if ( !a2->m_xOnly )
*((float *)Ptr + 9) = v21 + *((float *)Ptr + 9);
if ( !a2->m_yOnly )
*((float *)Ptr + 8) = v20 + *((float *)Ptr + 8);
}
}
if ( ++arr > v8 )
return;
}
while ( Ptr != Myfirst[2
* ((0x100000001B3LL
* (((unsigned __int64)(unsigned int)m_eObjType >> 24)
^ (0x100000001B3LL
* (BYTE2(m_eObjType)
^ (0x100000001B3LL
* ((0x100000001B3LL * ((unsigned __int8)m_eObjType ^ 0xCBF29CE484222325uLL))
^ BYTE1(m_eObjType)))))))
& a1->m_gameState.m_gameObjectPhysics._Mask)]._Ptr )
{
Ptr = *((std::_List_val>>::_Nodeptr *)Ptr + 1);
if ( m_eObjType == *((_DWORD *)Ptr + 4) )
{
p_List = &a1->m_gameState.m_gameObjectPhysics._List;
goto LABEL_12;
}
}
p_List = &a1->m_gameState.m_gameObjectPhysics._List;
LABEL_11:
Ptr = nullptr;
goto LABEL_12;
}
}
}
}