//
// GJBaseGameLayer::processAdvancedFollowAction from 0x1001f98d0 to 0x1001fa7a0 (3792 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processAdvancedFollowActions @ 0x1001f8870
//
// 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 __fastcall GJBaseGameLayer::processAdvancedFollowAction(
GJBaseGameLayer *a1,
AdvancedFollowInstance *a2,
bool a3,
float a4)
{
AdvancedFollowInstance *v6; // x26
AdvancedFollowTriggerObject *m_gameObject; // x27
int v9; // w9
int v10; // w10
int v11; // w9
int v12; // w23
char v13; // w20
cocos2d::CCArray *Group; // x0
cocos2d::ccArray *data; // x9
__int64 num; // x8
GameObject **arr; // x22
unsigned __int64 v18; // x28
GameObject *v19; // x24
GameObjectPhysics *GameObjectPhysics; // x0
float32x2_t *v21; // x25
signed int m_commandIndex; // w8
intptr_t m_uniqueID; // x24
cocos2d::CCDictionary *v24; // x0
cocos2d::CCArray *v25; // x0
float m_delayVariance; // s1
float v27; // s0
float m_maxSpeedVariance; // s0
float v29; // s13
float v30; // s11
float m_acceleration; // s12
float m_accelerationVariance; // s2
float m_maxRange; // s8
float m_maxRangeVariance; // s2
float v35; // s9
float v36; // s10
int m_otherObjectKey; // w1
float v38; // s0
GameObject *MainObject; // x0
float m_startSpeed; // s8
float m_startSpeedVariance; // s9
float v42; // s9
float v43; // s14
float v44; // s15
float m_startDirection; // s8
float m_startDirectionVariance; // s11
float v47; // s0
int m_startMode; // w8
float v49; // s0
unsigned int v50; // w8
float v51; // s13
int m_followMode; // w8
float m_steerForceVariance; // s3
float v54; // s1
float v55; // s2
float m_steerForceLowVariance; // s4
float m_steerFroceHighVariance; // s7
float v58; // s6
float v59; // s5
float m_speedRangeLowVariance; // s16
float m_speedRangeHigh; // s16
float m_speedRangeHighVariance; // s18
float v63; // s12
float v64; // s17
float m_breakForceVariance; // s18
float m_breakAngleVariance; // s18
float v67; // s20
float v68; // s8
float m_breakSteerForceVariance; // s18
float m_breakSteerSpeedLimitVariance; // s18
float v71; // s21
float v72; // s15
float v73; // s11
float m_nearDistanceVariance; // s2
float v75; // s0
float v76; // s1
float m_frictionVariance; // s2
float v78; // s9
float v79; // s8
float m_nearAccelerationVariance; // s2
float v81; // s0
float v82; // s1
float m_nearFrictionVariance; // s2
float v84; // s2
float v85; // s9
float m_easingVariance; // s0
float v87; // s1
float v88; // s0
bool v89; // cc
float v90; // s0
float v91; // s10
float m_rotateEasing; // s8
float v93; // s0
float v94; // s1
float v95; // s2
float v96; // s3
float v98; // s10
float v99; // s9
float v100; // s13
float v101; // s0
float v102; // s1
float v103; // s12
float v104; // s8
float v105; // s2
float v107; // s0
float v108; // s1
float v109; // s11
float v110; // s8
float v111; // s1
float v112; // s0
__int64 *v113; // x1
float v114; // s10
float v115; // s8
float v116; // s0
float v117; // s1
float v118; // w8
float v119; // s0
float v120; // s1
float v121; // s2
float v122; // s2
float v123; // s1
float v124; // s1
GJBaseGameLayer *v125; // x0
intptr_t v126; // x25
cocos2d::CCDictionary *v127; // x0
cocos2d::CCArray *v128; // x0
intptr_t v129; // x25
cocos2d::CCDictionary *v130; // x0
cocos2d::CCArray *v131; // x25
float v132; // s3
float v133; // s2
char v134; // w8
__n128 v135; // q0
__n128 v136; // q1
float v137; // [xsp+Ch] [xbp-124h]
float v138; // [xsp+10h] [xbp-120h]
float m_breakSteerSpeedLimit; // [xsp+14h] [xbp-11Ch]
float m_breakSteerForce; // [xsp+18h] [xbp-118h]
float v141; // [xsp+1Ch] [xbp-114h]
float v142; // [xsp+20h] [xbp-110h]
float v143; // [xsp+24h] [xbp-10Ch]
float m_breakAngle; // [xsp+28h] [xbp-108h]
float m_breakForce; // [xsp+2Ch] [xbp-104h]
_BOOL4 m_targetDirection; // [xsp+30h] [xbp-100h]
float v147; // [xsp+34h] [xbp-FCh]
float v148; // [xsp+38h] [xbp-F8h]
_BOOL4 m_rotateDirection; // [xsp+3Ch] [xbp-F4h]
AdvancedFollowInstance *v150; // [xsp+40h] [xbp-F0h]
int v151; // [xsp+4Ch] [xbp-E4h]
float m_maxSpeed; // [xsp+50h] [xbp-E0h]
int m_objectKey; // [xsp+54h] [xbp-DCh]
std::array *p_m_varianceValues; // [xsp+58h] [xbp-D8h]
int v155; // [xsp+60h] [xbp-D0h]
__int64 v156; // [xsp+64h] [xbp-CCh] BYREF
float32x2_t v157; // [xsp+6Ch] [xbp-C4h] BYREF
float32x2_t v158; // [xsp+74h] [xbp-BCh] BYREF
float32x2_t v159; // [xsp+7Ch] [xbp-B4h] BYREF
float32x2_t v160; // [xsp+84h] [xbp-ACh] BYREF
int v161; // [xsp+8Ch] [xbp-A4h] BYREF
int *v162; // [xsp+90h] [xbp-A0h] BYREF
__float2 v163; // 0:kr28_8.8
cocos2d::CCPoint v164; // 0:s1.4,4:s2.4
cocos2d::CCPoint v165; // 0:s3.4,4:s4.4
v6 = a2;
m_gameObject = a2->m_gameObject;
if ( a2->m_gameObject->m_ignoreGroupParent )
v9 = 110000000;
else
v9 = 100000000;
if ( a2->m_gameObject->m_ignoreLinkedObjects )
v10 = 1000000;
else
v10 = 0;
v161 = v9 + a2->m_group + v10;
if ( sub_100018814(&a1->m_targetGroups.__table_.__bucket_list_.__ptr_.__value_, &v161) )
{
v162 = &v161;
v11 = *(_DWORD *)(sub_10020A390(&a1->m_targetGroups, &v161, &unk_10063A31C, &v162, &v160) + 20);
}
else
{
v11 = 0;
}
v12 = 0;
m_objectKey = v6->m_objectKey;
m_rotateDirection = m_gameObject->m_rotateDirection;
v151 = v11 - 1;
p_m_varianceValues = &a1->m_varianceValues;
v13 = 1;
v150 = v6;
v155 = v11;
v137 = a4;
do
{
if ( v11 < 1 )
{
Group = GJBaseGameLayer::getGroup(a1, v6->m_group);
if ( !Group )
goto LABEL_221;
LABEL_15:
data = Group->data;
num = data->num;
if ( !(_DWORD)num )
goto LABEL_221;
arr = (GameObject **)data->arr;
v18 = (unsigned __int64)&arr[num - 1];
while ( 1 )
{
v19 = *arr;
if ( !*arr )
goto LABEL_221;
GameObjectPhysics = GJGameState::getGameObjectPhysics(&a1->m_gameState, *arr);
v21 = (float32x2_t *)GameObjectPhysics;
m_commandIndex = a1->m_gameState.m_commandIndex;
if ( a3 )
{
if ( GameObjectPhysics->m_unkInt2 < m_commandIndex )
{
GameObjectPhysics->m_unkInt2 = m_commandIndex;
if ( (v12 & 1) != 0 )
{
m_uniqueID = v19->m_uniqueID;
v24 = (cocos2d::CCDictionary *)sub_10024A388(a1->m_targetGroupsArray, (unsigned int)(v155 + 1));
v25 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v24, m_uniqueID);
GJBaseGameLayer::moveObjects(a1, v25, 0.0, 0.0, 0);
}
else
{
GJBaseGameLayer::moveObject(a1, v19, 0.0, 0.0, 0);
}
}
goto LABEL_207;
}
if ( GameObjectPhysics->m_unkInt3 >= m_commandIndex )
goto LABEL_207;
m_delayVariance = m_gameObject->m_delayVariance;
v27 = 0.0;
if ( m_delayVariance != 0.0 )
v27 = m_delayVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex];
v136.n128_u32[0] = COERCE_UNSIGNED_INT(GJBaseGameLayer::getSavedPosition(
a1,
m_objectKey,
m_gameObject->m_delay + v27).y);
if ( m_gameObject->m_ignoreDisabled && v19->m_isGroupDisabled )
goto LABEL_207;
v135.n128_u32[0] = (unsigned int)v162;
if ( *(float *)&v162 == 0.0 )
{
v135.n128_u32[0] = HIDWORD(v162);
if ( *((float *)&v162 + 1) == 0.0 )
goto LABEL_207;
}
((void (__fastcall *)(float32x2_t *__return_ptr, GameObject *, __n128, __n128))v19->getRealPosition)(
&v159,
v19,
v135,
v136);
sub_1000229F0((float32x2_t *)&v162, &v159, &v160);
m_maxSpeedVariance = m_gameObject->m_maxSpeedVariance;
v29 = 0.0;
v30 = 0.0;
if ( m_maxSpeedVariance != 0.0 )
v30 = m_maxSpeedVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 1];
m_maxSpeed = m_gameObject->m_maxSpeed;
m_acceleration = m_gameObject->m_acceleration;
m_accelerationVariance = m_gameObject->m_accelerationVariance;
if ( m_accelerationVariance != 0.0 )
v29 = m_accelerationVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 2];
m_maxRange = m_gameObject->m_maxRange;
m_maxRangeVariance = m_gameObject->m_maxRangeVariance;
v35 = 0.0;
if ( m_maxRangeVariance != 0.0 )
v35 = m_maxRangeVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 3];
v36 = sqrtf((float)(v160.f32[1] * v160.f32[1]) + (float)(v160.f32[0] * v160.f32[0]));
m_otherObjectKey = v6->m_otherObjectKey;
v38 = v36;
if ( m_otherObjectKey >= 1 )
{
MainObject = GJBaseGameLayer::tryGetMainObject(a1, m_otherObjectKey);
v38 = v36;
if ( MainObject )
{
((void (__fastcall *)(float32x2_t *__return_ptr, float))MainObject->getRealPosition)(&v158, v36);
sub_1000229F0((float32x2_t *)&v162, &v158, &v159);
v38 = sqrtf((float)(v159.f32[1] * v159.f32[1]) + (float)(v159.f32[0] * v159.f32[0]));
}
}
if ( m_gameObject->m_xOnly )
{
v160.i32[1] = 0;
}
else if ( m_gameObject->m_yOnly )
{
v160.i32[0] = 0;
}
if ( (float)(m_maxRange + v35) != 0.0 && v38 > (float)(m_maxRange + v35) )
goto LABEL_207;
if ( !v6->m_processed )
{
m_startSpeed = m_gameObject->m_startSpeed;
m_startSpeedVariance = m_gameObject->m_startSpeedVariance;
v42 = m_startSpeed + (float)(m_startSpeedVariance * GameToolbox::fast_rand_0_1());
if ( v42 != 0.0 )
break;
}
LABEL_60:
v6->m_processed = 1;
v50 = a1->m_gameState.m_commandIndex;
v21[4].i32[1] = v50;
if ( m_gameObject->m_exclusive )
v21[5].i32[0] = v50;
v51 = (float)(m_acceleration + v29) * 0.01;
m_followMode = m_gameObject->m_followMode;
if ( m_followMode == 1 )
{
m_nearDistanceVariance = m_gameObject->m_nearDistanceVariance;
v75 = 0.0;
v76 = 0.0;
if ( m_nearDistanceVariance != 0.0 )
v76 = m_nearDistanceVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 6];
m_frictionVariance = m_gameObject->m_frictionVariance;
if ( m_frictionVariance != 0.0 )
v75 = m_frictionVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 7];
v78 = m_gameObject->m_nearDistance + v76;
v79 = (float)(m_gameObject->m_friction + v75) * 0.01;
cocos2d::ccpNormalize((const cocos2d::CCPoint *)&v160);
if ( v78 > 0.0 && v36 < v78 )
{
m_nearAccelerationVariance = m_gameObject->m_nearAccelerationVariance;
v81 = 0.0;
v82 = 0.0;
if ( m_nearAccelerationVariance != 0.0 )
v82 = m_nearAccelerationVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 8];
m_nearFrictionVariance = m_gameObject->m_nearFrictionVariance;
if ( m_nearFrictionVariance != 0.0 )
v81 = m_nearFrictionVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 9];
v84 = 1.0 - (float)(v36 / v78);
v51 = v51 + (float)(v84 * (float)((float)((float)(m_gameObject->m_nearAcceleration + v82) * 0.01) - v51));
v79 = v79 + (float)(v84 * (float)((float)((float)(m_gameObject->m_nearFriction + v81) * 0.01) - v79));
}
if ( v79 != 0.0 )
{
sub_100022A14(v21 + 1, &v157, v79 * a4);
sub_1000229F0(v21 + 1, &v157, &v158);
if ( !m_gameObject->m_xOnly )
v21[1].i32[1] = v158.i32[1];
if ( !m_gameObject->m_yOnly )
v21[1].i32[0] = v158.i32[0];
}
sub_100022A14(&v159, &v157, v51 * a4);
sub_1000229DC(v21 + 1, &v157, &v158);
if ( !m_gameObject->m_xOnly )
v21[1].i32[1] = v158.i32[1];
if ( !m_gameObject->m_yOnly )
v21[1].i32[0] = v158.i32[0];
v85 = a4;
LABEL_119:
if ( v36 >= m_gameObject->m_rotateDeadZ )
{
v91 = atan2f(v21[1].f32[1], v21[1].f32[0]);
v21[3].f32[0] = v91;
}
else
{
v91 = v21[3].f32[0];
}
m_rotateEasing = m_gameObject->m_rotateEasing;
v93 = atan2f(v21[2].f32[1], v21[2].f32[0]);
v94 = v91 - v93;
if ( (float)(v91 - v93) < -3.1416 )
{
v95 = ceilf(floorf(fabsf(v94) / 3.1416) * 0.5);
v96 = 6.2832;
goto LABEL_126;
}
if ( v94 > 3.1416 )
{
v95 = ceilf(floorf(v94 / 3.1416) * 0.5);
v96 = -6.2832;
LABEL_126:
v94 = v94 + (float)(v95 * v96);
}
cocos2d::ccpForAngle(v93 + (float)(v94 / fmaxf(m_rotateEasing, 1.0)));
sub_1000229D0(&v21[2], (double *)&v159);
goto LABEL_173;
}
if ( m_followMode != 2 )
{
m_easingVariance = m_gameObject->m_easingVariance;
v87 = 0.0;
if ( m_easingVariance != 0.0 )
v87 = m_easingVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 6];
v88 = m_gameObject->m_easing + v87;
v89 = v88 > 1.0;
if ( v88 <= 1.0 )
v85 = 1.0;
else
v85 = a4;
v90 = 1.0 / v88;
if ( !v89 )
v90 = 1.0;
sub_100022A14(&v160, &v159, v90);
if ( !m_gameObject->m_xOnly )
v21[1].i32[1] = v159.i32[1];
if ( !m_gameObject->m_yOnly )
v21[1].i32[0] = v159.i32[0];
goto LABEL_119;
}
m_targetDirection = m_gameObject->m_targetDirection;
sub_1000229B8((__int64 *)&v159, (__int64 *)&v21[2]);
cocos2d::ccpNormalize((const cocos2d::CCPoint *)&v160);
if ( sub_100022A38((float *)&v21[2]) )
sub_1000229D0(&v21[2], (double *)&v158);
m_steerForceVariance = m_gameObject->m_steerForceVariance;
v54 = 0.0;
v55 = 0.0;
if ( m_steerForceVariance != 0.0 )
v55 = m_steerForceVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 9];
m_steerForceLowVariance = m_gameObject->m_steerForceLowVariance;
if ( m_steerForceLowVariance != 0.0 )
v54 = m_steerForceLowVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 10];
m_steerFroceHighVariance = m_gameObject->m_steerFroceHighVariance;
v58 = 0.0;
v59 = 0.0;
if ( m_steerFroceHighVariance != 0.0 )
v59 = m_steerFroceHighVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 11];
m_speedRangeLowVariance = m_gameObject->m_speedRangeLowVariance;
if ( m_speedRangeLowVariance != 0.0 )
v58 = m_speedRangeLowVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 12];
m_speedRangeHigh = m_gameObject->m_speedRangeHigh;
m_speedRangeHighVariance = m_gameObject->m_speedRangeHighVariance;
v63 = 0.0;
v64 = 0.0;
if ( m_speedRangeHighVariance != 0.0 )
v64 = m_speedRangeHighVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 13];
m_breakForce = m_gameObject->m_breakForce;
m_breakForceVariance = m_gameObject->m_breakForceVariance;
if ( m_breakForceVariance != 0.0 )
v63 = m_breakForceVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 14];
m_breakAngle = m_gameObject->m_breakAngle;
m_breakAngleVariance = m_gameObject->m_breakAngleVariance;
v67 = 0.0;
v68 = 0.0;
if ( m_breakAngleVariance != 0.0 )
v68 = m_breakAngleVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 15];
m_breakSteerForce = m_gameObject->m_breakSteerForce;
m_breakSteerForceVariance = m_gameObject->m_breakSteerForceVariance;
if ( m_breakSteerForceVariance != 0.0 )
v67 = m_breakSteerForceVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 16];
m_breakSteerSpeedLimit = m_gameObject->m_breakSteerSpeedLimit;
m_breakSteerSpeedLimitVariance = m_gameObject->m_breakSteerSpeedLimitVariance;
v71 = 0.0;
if ( m_breakSteerSpeedLimitVariance != 0.0 )
v71 = m_breakSteerSpeedLimitVariance * p_m_varianceValues->__elems_[v19->m_varianceIndex + 16];
v147 = v51;
v148 = v30;
v142 = v21[1].f32[1];
v143 = v21[1].f32[0];
v72 = fabsf(sqrtf((float)(v142 * v142) + (float)(v143 * v143)));
v141 = v67;
v138 = v71;
if ( m_gameObject->m_steerForceLowEnabled && v72 <= (float)(m_gameObject->m_speedRangeLow + v58) )
{
v73 = m_gameObject->m_steerForceLow + v54;
}
else
{
v73 = m_gameObject->m_steerForce + v55;
if ( m_gameObject->m_steerForceHighEnabled
&& v72 >= (float)(m_speedRangeHigh + v64)
&& (float)(m_speedRangeHigh + v64) > 0.0 )
{
v73 = m_gameObject->m_steerForceHigh + v59;
}
}
v98 = atan2f(v158.f32[1], v158.f32[0]);
v99 = atan2f(v21[2].f32[1], v21[2].f32[0]);
v100 = v98 - v99;
if ( (float)(v98 - v99) >= -3.1416 )
{
if ( v100 <= 3.1416 )
goto LABEL_139;
v101 = ceilf(floorf(v100 / 3.1416) * 0.5);
v102 = -6.2832;
}
else
{
v101 = ceilf(floorf(fabsf(v100) / 3.1416) * 0.5);
v102 = 6.2832;
}
v100 = v100 + (float)(v101 * v102);
LABEL_139:
v103 = (float)(m_breakForce + v63) * 0.01;
v104 = (float)(m_breakAngle + v68) * 0.017453;
if ( v103 > 0.0 )
{
v105 = fabsf(v100);
if ( v72 > (float)(m_breakSteerSpeedLimit + v138) && v105 > v104 )
v73 = m_breakSteerForce + v141;
}
a4 = v137;
v107 = v21[3].f32[1] + (float)((float)((float)(v73 * 0.01) - v21[3].f32[1]) / 10.0);
v21[3].f32[1] = v107;
v108 = -v107;
if ( v100 > (float)-v107 )
v108 = v100;
if ( v107 > v100 )
v107 = v100;
if ( v100 >= 0.0 )
v109 = v107;
else
v109 = v108;
if ( v109 != 0.0 )
{
v163 = __sincosf_stret(v109 * v137);
if ( !m_gameObject->m_xOnly )
v21[1].f32[1] = (float)(v143 * v163.__sinval) + (float)(v142 * v163.__cosval);
if ( !m_gameObject->m_yOnly )
v21[1].f32[0] = (float)(v143 * v163.__cosval) - (float)(v142 * v163.__sinval);
cocos2d::ccpForAngle((float)(v109 * v137) + v99);
sub_1000229D0(&v21[2], (double *)&v157);
}
if ( v103 <= 0.0 )
{
v110 = v147;
v30 = v148;
}
else
{
v89 = vabds_f32(v100, v109) <= v104;
v110 = v147;
v30 = v148;
if ( !v89 )
{
v111 = fabsf((float)(v103 * v21[2].f32[0]) * v137);
v112 = v21[1].f32[0];
if ( v112 >= 0.0 )
{
if ( v112 <= v111 )
v111 = v21[1].f32[0];
}
else
{
v111 = -v111;
if ( v112 >= v111 )
v111 = v21[1].f32[0];
}
v132 = fabsf((float)(v103 * v21[2].f32[1]) * v137);
v133 = v21[1].f32[1];
if ( v133 >= 0.0 )
{
if ( v133 <= v132 )
v132 = v21[1].f32[1];
}
else
{
v132 = -v132;
if ( v133 >= v132 )
v132 = v21[1].f32[1];
}
if ( !m_gameObject->m_xOnly )
v21[1].f32[1] = v133 - v132;
v110 = 0.0;
if ( !m_gameObject->m_yOnly )
v21[1].f32[0] = v112 - v111;
}
}
if ( m_targetDirection )
v113 = (__int64 *)&v158;
else
v113 = (__int64 *)&v21[2];
sub_1000229B8((__int64 *)&v157, v113);
if ( !m_gameObject->m_xOnly )
v21[1].f32[1] = v21[1].f32[1] + (float)((float)(v110 * v157.f32[1]) * v137);
if ( !m_gameObject->m_yOnly )
v21[1].f32[0] = v21[1].f32[0] + (float)((float)(v110 * v157.f32[0]) * v137);
v85 = v137;
LABEL_173:
v114 = 0.0;
if ( !m_rotateDirection )
goto LABEL_180;
v115 = (float)((float)(atan2f(v21[2].f32[1], v21[2].f32[0]) * -57.296) + 90.0) + m_gameObject->m_rotationOffset;
v116 = v115 - ((float (__fastcall *)(GameObject *))v19->getRotation)(v19);
if ( v116 < -180.0 )
{
v117 = ceilf(floorf(fabsf(v116) / 180.0) * 0.5);
v118 = 360.0;
LABEL_178:
v116 = v116 + (float)(v117 * v118);
goto LABEL_179;
}
if ( v116 > 180.0 )
{
v117 = ceilf(floorf(v116 / 180.0) * 0.5);
v118 = -360.0;
goto LABEL_178;
}
LABEL_179:
v114 = v116 * 0.25;
LABEL_180:
v119 = m_maxSpeed + v30;
v120 = v21[1].f32[0];
if ( m_gameObject->m_xOnly )
{
if ( v119 > 0.0 )
{
v121 = fabsf(v120);
if ( v121 > v119 )
v21[1].f32[0] = v120 * (float)(v119 / v121);
}
}
else
{
v122 = v21[1].f32[1];
if ( m_gameObject->m_yOnly )
{
if ( v119 > 0.0 )
{
v123 = fabsf(v122);
if ( v123 > v119 )
v21[1].f32[1] = (float)(v119 / v123) * v122;
}
}
else if ( v119 > 0.0 )
{
v124 = sqrtf((float)(v122 * v122) + (float)(v120 * v120));
if ( v124 > v119 )
{
sub_100022A14(v21 + 1, &v159, v119 / v124);
sub_1000229D0(&v21[1], (double *)&v159);
}
}
}
sub_1000229B8((__int64 *)&v159, &qword_10086C9A0);
sub_100022A14(v21 + 1, &v158, v85);
if ( m_gameObject->m_xOnly )
{
v158.i32[1] = 0;
v6 = v150;
}
else
{
v6 = v150;
if ( m_gameObject->m_yOnly )
v158.i32[0] = 0;
}
if ( v158.f32[0] != 0.0 || v158.f32[1] != 0.0 )
{
if ( (v12 & 1) != 0 )
{
if ( v114 != 0.0 )
sub_1000229D0(&v159, (double *)&v158);
v126 = v19->m_uniqueID;
v127 = (cocos2d::CCDictionary *)sub_10024A388(a1->m_targetGroupsArray, (unsigned int)(v155 + 1));
v128 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v127, v126);
GJBaseGameLayer::moveObjects(a1, v128, v158.f32[0], v158.f32[1], 0);
if ( v114 == 0.0 )
goto LABEL_207;
LABEL_206:
v129 = v19->m_uniqueID;
v130 = (cocos2d::CCDictionary *)sub_10024A388(a1->m_targetGroupsArray, (unsigned int)(v155 + 1));
v131 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v130, v129);
GameObject::getUnmodifiedPosition(v19);
sub_1000229B8(&v156, (__int64 *)&v159);
GJBaseGameLayer::rotateObjects(a1, v131, v114, v164, v165, (bool)&v157, (bool)&v156);
goto LABEL_207;
}
GJBaseGameLayer::moveObject(a1, v19, v158.f32[0], v158.f32[1], 0);
}
if ( v114 != 0.0 )
{
if ( (v13 & 1) == 0 )
goto LABEL_206;
GJBaseGameLayer::rotateObject(v125, v19, v114);
}
LABEL_207:
if ( (unsigned __int64)++arr > v18 )
goto LABEL_221;
}
v43 = a4;
v44 = v30;
m_startDirection = m_gameObject->m_startDirection;
m_startDirectionVariance = m_gameObject->m_startDirectionVariance;
v47 = GameToolbox::fast_rand_0_1();
GJBaseGameLayer::getFollowSpeedVal(
a1,
v19,
m_gameObject->m_startSpeedReference,
m_gameObject->m_startDirectionReference,
m_startDirection + (float)(m_startDirectionVariance * v47),
v42);
if ( v21[4].i32[1] )
{
m_startMode = m_gameObject->m_startMode;
if ( m_startMode == 2 )
{
if ( !m_gameObject->m_xOnly )
v21[1].f32[1] = v159.f32[1] + v21[1].f32[1];
if ( m_gameObject->m_yOnly )
goto LABEL_59;
v49 = v159.f32[0] + v21[1].f32[0];
LABEL_58:
v21[1].f32[0] = v49;
goto LABEL_59;
}
if ( m_startMode != 1 )
{
LABEL_59:
v30 = v44;
a4 = v43;
goto LABEL_60;
}
}
if ( !m_gameObject->m_xOnly )
v21[1].i32[1] = v159.i32[1];
if ( m_gameObject->m_yOnly )
goto LABEL_59;
v49 = v159.f32[0];
goto LABEL_58;
}
Group = (cocos2d::CCArray *)sub_10024A388(a1->m_targetGroupsArray, (unsigned int)(v151 + v12));
if ( Group )
goto LABEL_15;
LABEL_221:
v11 = v155;
v134 = (v155 > 0) & v13;
v12 = 1;
v13 = 0;
}
while ( (v134 & 1) != 0 );
}