//
// GJBaseGameLayer::processAdvancedFollowAction from 0x883aa8 to 0x884afc (4180 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::processAdvancedFollowActions @ 0x89668c
// > GJBaseGameLayer::processAdvancedFollowActions @ 0x8967dc
// > ??> @ 0x42498
//
// 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::processAdvancedFollowAction(GJBaseGameLayer *a1, AdvancedFollowInstance *a2, bool a3, float a4)
{
AdvancedFollowTriggerObject *m_gameObject; // x26
std::unordered_map> *p_m_targetGroups; // x19
int i; // w24
cocos2d::CCArray *Group; // x0
cocos2d::ccArray *data; // x1
GameObject **arr; // x19
__int64 v11; // x0
char *v12; // x28
GameObject *v13; // x20
GameObjectPhysics *v14; // x25
float m_delayVariance; // s2
float v16; // s1
float v17; // s9
float m_maxSpeedVariance; // s0
float m_maxSpeed; // s12
float v20; // s8
float m_accelerationVariance; // s0
float m_acceleration; // s10
float v23; // s11
float m_maxRangeVariance; // s1
float v25; // s0
float v26; // s13
float v27; // s1
int m_otherObjectKey; // w1
GameObject *MainObject; // x0
unsigned int v30; // w0
_BOOL4 m_exclusive; // w1
int m_followMode; // w0
float v33; // s10
float m_easingVariance; // s2
float v35; // s1
float v36; // s1
float v37; // s0
float *p_m_unkPoint1; // x22
float m_rotateEasing; // s10
float m_unkFloat1; // s9
float v41; // s0
float v42; // s9
float v43; // s0
float v44; // s10
float v45; // s8
float v46; // s1
float v47; // s0
float v48; // s1
float v49; // s0
float v50; // s1
float v51; // s0
cocos2d::CCArray *v52; // x22
GameObjectPhysics *GameObjectPhysics; // x0
signed int m_commandIndex; // w1
float v55; // s0
float v56; // s1
float v57; // s9
float v58; // s0
float m_startSpeed; // s14
float m_startSpeedVariance; // s13
float v61; // s1
float m_startDirection; // s13
float m_startDirectionVariance; // s14
float v64; // s0
int m_startMode; // w0
float v66; // s0
float v67; // s1
float v68; // s0
float m_nearDistanceVariance; // s1
float v70; // s0
float m_frictionVariance; // s2
float v72; // s13
float v73; // s0
float v74; // s11
float m_nearAccelerationVariance; // s2
float v76; // s0
float m_nearFrictionVariance; // s3
float v78; // s1
float v79; // s0
float v80; // s13
float v81; // s0
float v82; // s1
float m_steerForceVariance; // s0
float m_steerForce; // s17
float v85; // s6
float m_steerForceLowVariance; // s0
float v87; // s4
float m_steerFroceHighVariance; // s0
float v89; // s16
float m_speedRangeLowVariance; // s5
float v91; // s0
float m_speedRangeHighVariance; // s1
float v93; // s3
float v94; // s0
float m_breakForceVariance; // s5
float v96; // s9
float v97; // s11
float m_breakAngleVariance; // s0
float v99; // s14
float v100; // s11
float m_breakSteerForceVariance; // s0
float v102; // s14
float m_breakSteerSpeedLimitVariance; // s0
float v104; // s5
float v105; // s9
float v106; // s13
float v107; // s0
float v108; // s0
float v109; // s3
float v110; // s13
float v111; // s0
float x; // s4
float y; // s1
float v114; // s0
float v115; // s3
float v116; // s1
float v117; // s4
float v118; // s0
const cocos2d::CCPoint *v119; // x1
int v120; // w0
cocos2d::CCArray *TargetGroup; // x0
cocos2d::CCArray *v122; // x0
cocos2d::CCArray *v123; // x0
long double v124; // q0
long double v125; // q1
float v126; // [xsp+100h] [xbp+100h]
float m_breakSteerForce; // [xsp+110h] [xbp+110h]
float m_breakSteerSpeedLimit; // [xsp+114h] [xbp+114h]
float v129; // [xsp+118h] [xbp+118h]
float v130; // [xsp+118h] [xbp+118h]
_BOOL4 m_targetDirection; // [xsp+11Ch] [xbp+11Ch]
_BOOL4 m_rotateDirection; // [xsp+120h] [xbp+120h]
int m_objectKey; // [xsp+128h] [xbp+128h]
int v135; // [xsp+12Ch] [xbp+12Ch]
int v136; // [xsp+130h] [xbp+130h]
float *p_m_unkPoint2; // [xsp+138h] [xbp+138h]
_BOOL4 v138; // [xsp+140h] [xbp+140h]
float v139; // [xsp+140h] [xbp+140h]
float v140; // [xsp+140h] [xbp+140h]
float v141; // [xsp+150h] [xbp+150h]
int v143; // [xsp+168h] [xbp+168h]
_BOOL4 v144; // [xsp+16Ch] [xbp+16Ch]
int SpecialKey; // [xsp+174h] [xbp+174h] BYREF
float v146; // [xsp+178h] [xbp+178h] BYREF
float v147; // [xsp+17Ch] [xbp+17Ch]
cocos2d::CCPoint v148; // [xsp+180h] [xbp+180h] BYREF
cocos2d::CCPoint v149; // [xsp+188h] [xbp+188h] BYREF
cocos2d::CCPoint v150; // [xsp+190h] [xbp+190h] BYREF
__int64 v151; // [xsp+198h] [xbp+198h] BYREF
cocos2d::CCPoint v152; // [xsp+1A0h] [xbp+1A0h] BYREF
cocos2d::CCPoint v153; // 0:kr08_8.8
cocos2d::CCPoint v154; // 0:kr30_8.8
cocos2d::CCPoint v155; // 0:s1.4,4:s2.4
cocos2d::CCPoint v156; // 0:s3.4,4:s4.4
m_gameObject = a2->m_gameObject;
v144 = a3;
p_m_targetGroups = &a1->m_targetGroups;
SpecialKey = GJBaseGameLayer::getSpecialKey(
a1,
a2->m_group,
m_gameObject->m_ignoreGroupParent,
m_gameObject->m_ignoreLinkedObjects);
if ( sub_856030(p_m_targetGroups, SpecialKey) )
{
v135 = *(_DWORD *)std::__detail::_Map_base>,std::allocator>>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits,true>::operator[](
(__int64)p_m_targetGroups,
(unsigned int *)&SpecialKey);
m_rotateDirection = m_gameObject->m_rotateDirection;
if ( v135 <= 0 )
v120 = 1;
else
v120 = 2;
m_objectKey = a2->m_objectKey;
v143 = v120;
}
else
{
v135 = 0;
m_objectKey = a2->m_objectKey;
m_rotateDirection = m_gameObject->m_rotateDirection;
v143 = 1;
}
for ( i = 0; i != v143; ++i )
{
if ( v135 <= 0 )
Group = GJBaseGameLayer::getGroup(a1, a2->m_group);
else
Group = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(a1->m_targetGroupsArray, v135 - 1 + i);
if ( Group )
{
data = Group->data;
if ( data->num )
{
arr = (GameObject **)data->arr;
v11 = 8LL * data->num - 8;
v12 = (char *)arr + v11;
if ( arr <= (GameObject **)((char *)arr + v11) )
{
v13 = *arr;
if ( *arr )
{
while ( 1 )
{
if ( v144 )
{
GameObjectPhysics = GJGameState::getGameObjectPhysics(&a1->m_gameState, v13);
m_commandIndex = a1->m_gameState.m_commandIndex;
if ( GameObjectPhysics->m_unkInt2 < m_commandIndex )
{
GameObjectPhysics->m_unkInt2 = m_commandIndex;
if ( i == 1 )
{
TargetGroup = GJBaseGameLayer::getTargetGroup(a1, v135, v13->m_uniqueID);
GJBaseGameLayer::moveObjects(a1, TargetGroup, 0.0, 0.0, 0);
}
else
{
GJBaseGameLayer::moveObject(a1, v13, 0.0, 0.0, 0);
}
}
goto LABEL_63;
}
v14 = GJGameState::getGameObjectPhysics(&a1->m_gameState, v13);
if ( v14->m_unkInt3 >= (signed int)a1->m_gameState.m_commandIndex )
goto LABEL_63;
m_delayVariance = m_gameObject->m_delayVariance;
v16 = 0.0;
if ( m_delayVariance != 0.0 )
v16 = m_delayVariance * a1->m_varianceValues.__elems_[v13->m_varianceIndex];
LODWORD(v125) = COERCE_UNSIGNED_INT(GJBaseGameLayer::getSavedPosition(
a1,
m_objectKey,
m_gameObject->m_delay + v16).y);
if ( m_gameObject->m_ignoreDisabled && v13->m_isGroupDisabled )
goto LABEL_63;
*(float *)&v124 = v146;
if ( v146 == 0.0 )
{
*(float *)&v124 = v147;
if ( v147 == 0.0 )
goto LABEL_63;
}
((void (__fastcall *)(cocos2d::CCPoint *__return_ptr, GameObject *, long double, long double))v13->getRealPosition)(
&v152,
v13,
v124,
v125);
cocos2d::CCPoint::operator-(&v148, &v146, &v152);
v17 = sqrtf((float)(v148.y * v148.y) + (float)(v148.x * v148.x));
m_maxSpeedVariance = m_gameObject->m_maxSpeedVariance;
m_maxSpeed = m_gameObject->m_maxSpeed;
v20 = 0.0;
if ( m_maxSpeedVariance != 0.0 )
v20 = m_maxSpeedVariance * a1->m_varianceValues.__elems_[v13->m_varianceIndex + 1];
m_accelerationVariance = m_gameObject->m_accelerationVariance;
m_acceleration = m_gameObject->m_acceleration;
v23 = 0.0;
if ( m_accelerationVariance != 0.0 )
v23 = m_accelerationVariance * *((float *)&a1->m_uID + v13->m_varianceIndex + 1097);
m_maxRangeVariance = m_gameObject->m_maxRangeVariance;
v25 = 0.0;
if ( m_maxRangeVariance != 0.0 )
v25 = m_maxRangeVariance * *((float *)&a1->m_nLuaID + v13->m_varianceIndex + 1097);
v26 = m_gameObject->m_maxRange + v25;
v27 = v17;
m_otherObjectKey = a2->m_otherObjectKey;
if ( m_otherObjectKey > 0 )
{
MainObject = GJBaseGameLayer::tryGetMainObject(a1, m_otherObjectKey);
if ( MainObject )
{
MainObject->getRealPosition((GameObject *)&v151);
cocos2d::CCPoint::operator-(&v152, &v146, &v151);
v27 = sqrtf((float)(v152.y * v152.y) + (float)(v152.x * v152.x));
}
else
{
v27 = v17;
}
}
if ( m_gameObject->m_xOnly )
{
v148.y = 0.0;
}
else if ( m_gameObject->m_yOnly )
{
v148.x = 0.0;
}
if ( v26 != 0.0 && v27 > v26 )
goto LABEL_63;
if ( !a2->m_processed )
{
m_startSpeed = m_gameObject->m_startSpeed;
m_startSpeedVariance = m_gameObject->m_startSpeedVariance;
v61 = m_startSpeed + (float)(m_startSpeedVariance * GameToolbox::fast_rand_0_1());
if ( v61 != 0.0 )
{
m_startDirection = m_gameObject->m_startDirection;
m_startDirectionVariance = m_gameObject->m_startDirectionVariance;
v141 = v61;
v64 = GameToolbox::fast_rand_0_1();
GJBaseGameLayer::getFollowSpeedVal(
a1,
v13,
m_gameObject->m_startSpeedReference,
m_gameObject->m_startDirectionReference,
m_startDirection + (float)(m_startDirectionVariance * v64),
v141);
if ( !v14->m_unkInt2 || (m_startMode = m_gameObject->m_startMode, m_startMode == 1) )
{
if ( !m_gameObject->m_xOnly )
v14->m_unkPoint1.y = v152.y;
if ( !m_gameObject->m_yOnly )
v14->m_unkPoint1.x = v152.x;
}
else if ( m_startMode == 2 )
{
if ( !m_gameObject->m_xOnly )
v14->m_unkPoint1.y = v14->m_unkPoint1.y + v152.y;
if ( !m_gameObject->m_yOnly )
v14->m_unkPoint1.x = v14->m_unkPoint1.x + v152.x;
}
}
}
v30 = a1->m_gameState.m_commandIndex;
a2->m_processed = 1;
m_exclusive = m_gameObject->m_exclusive;
v14->m_unkInt2 = v30;
if ( m_exclusive )
v14->m_unkInt3 = v30;
m_followMode = m_gameObject->m_followMode;
v33 = (float)(m_acceleration + v23) * 0.01;
if ( m_followMode != 2 )
{
if ( m_followMode == 1 )
{
m_nearDistanceVariance = m_gameObject->m_nearDistanceVariance;
v70 = 0.0;
if ( m_nearDistanceVariance != 0.0 )
v70 = m_nearDistanceVariance * *((float *)&a1->m_uAutoReleaseCount + v13->m_varianceIndex + 1097);
m_frictionVariance = m_gameObject->m_frictionVariance;
v72 = m_gameObject->m_nearDistance + v70;
v73 = 0.0;
if ( m_frictionVariance != 0.0 )
v73 = m_frictionVariance * *((float *)&a1->m_eObjType + v13->m_varianceIndex + 1097);
v74 = (float)(m_gameObject->m_friction + v73) * 0.01;
cocos2d::ccpNormalize(&v148);
if ( v72 > 0.0 && v72 > v17 )
{
m_nearAccelerationVariance = m_gameObject->m_nearAccelerationVariance;
v76 = 0.0;
if ( m_nearAccelerationVariance != 0.0 )
v76 = m_nearAccelerationVariance * *((float *)&a1->m_uIndexInArray + v13->m_varianceIndex + 1097);
m_nearFrictionVariance = m_gameObject->m_nearFrictionVariance;
v78 = 0.0;
v79 = (float)(m_gameObject->m_nearAcceleration + v76) * 0.01;
if ( m_nearFrictionVariance != 0.0 )
v78 = m_nearFrictionVariance * *((float *)&a1->m_uUnknown + v13->m_varianceIndex + 1097);
v80 = 1.0 - (float)(v17 / v72);
v33 = v33 + (float)((float)(v79 - v33) * v80);
v74 = v74
+ (float)((float)-(float)(v74 - (float)((float)(m_gameObject->m_nearFriction + v78) * 0.01))
* v80);
}
if ( v74 == 0.0 )
{
p_m_unkPoint1 = (float *)&v14->m_unkPoint1;
}
else
{
p_m_unkPoint1 = (float *)&v14->m_unkPoint1;
cocos2d::CCPoint::operator*(&v14->m_unkPoint1, v74 * a4);
cocos2d::CCPoint::operator-(&v151, &v14->m_unkPoint1, &v152);
if ( !m_gameObject->m_xOnly )
v14->m_unkPoint1.y = *((float *)&v151 + 1);
if ( !m_gameObject->m_yOnly )
LODWORD(v14->m_unkPoint1.x) = v151;
}
cocos2d::CCPoint::operator*(&v150, v33 * a4);
cocos2d::CCPoint::operator+(&v151, p_m_unkPoint1, &v152);
if ( !m_gameObject->m_xOnly )
v14->m_unkPoint1.y = *((float *)&v151 + 1);
if ( !m_gameObject->m_yOnly )
LODWORD(v14->m_unkPoint1.x) = v151;
v136 = 0;
}
else
{
m_easingVariance = m_gameObject->m_easingVariance;
v35 = 0.0;
if ( m_easingVariance != 0.0 )
v35 = m_easingVariance * *((float *)&a1->m_uAutoReleaseCount + v13->m_varianceIndex + 1097);
v36 = m_gameObject->m_easing + v35;
if ( v36 <= 1.0 )
{
v136 = 1;
v37 = 1.0;
}
else
{
v37 = 1.0 / v36;
v136 = 0;
}
cocos2d::CCPoint::operator*(&v148, v37);
if ( !m_gameObject->m_xOnly )
v14->m_unkPoint1.y = v152.y;
if ( !m_gameObject->m_yOnly )
v14->m_unkPoint1.x = v152.x;
p_m_unkPoint1 = (float *)&v14->m_unkPoint1;
}
if ( m_gameObject->m_rotateDeadZ <= v17 )
{
v68 = atan2f(p_m_unkPoint1[1], *p_m_unkPoint1);
m_rotateEasing = m_gameObject->m_rotateEasing;
v14->m_unkFloat1 = v68;
m_unkFloat1 = v68;
if ( m_rotateEasing > 1.0 )
goto LABEL_47;
}
else
{
m_rotateEasing = m_gameObject->m_rotateEasing;
m_unkFloat1 = v14->m_unkFloat1;
if ( m_rotateEasing > 1.0 )
{
LABEL_47:
p_m_unkPoint2 = (float *)&v14->m_unkPoint2;
v41 = atan2f(v14->m_unkPoint2.y, v14->m_unkPoint2.x);
v42 = GJBaseGameLayer::convertToClosestDirection(m_unkFloat1 - v41, 3.1416);
v43 = atan2f(v14->m_unkPoint2.y, v14->m_unkPoint2.x);
v153 = cocos2d::ccpForAngle((float)(v42 / m_rotateEasing) + v43);
cocos2d::CCPoint::operator=(&v14->m_unkPoint2, v153.x, v153.y);
goto LABEL_48;
}
}
m_rotateEasing = 1.0;
goto LABEL_47;
}
p_m_unkPoint2 = (float *)&v14->m_unkPoint2;
m_targetDirection = m_gameObject->m_targetDirection;
cocos2d::CCPoint::CCPoint(&v150, &v14->m_unkPoint2);
cocos2d::ccpNormalize(&v148);
if ( !(unsigned __int8)cocos2d::CCPoint::isZero(&v14->m_unkPoint2) )
break;
cocos2d::CCPoint::operator=(p_m_unkPoint2, v81, v82);
m_steerForceVariance = m_gameObject->m_steerForceVariance;
m_steerForce = m_gameObject->m_steerForce;
v85 = 0.0;
if ( m_steerForceVariance != 0.0 )
goto LABEL_120;
LABEL_121:
m_steerForceLowVariance = m_gameObject->m_steerForceLowVariance;
v87 = 0.0;
if ( m_steerForceLowVariance != 0.0 )
v87 = m_steerForceLowVariance * *((float *)&a1->m_unknown2 + v13->m_varianceIndex + 1097);
m_steerFroceHighVariance = m_gameObject->m_steerFroceHighVariance;
v89 = 0.0;
if ( m_steerFroceHighVariance != 0.0 )
v89 = m_steerFroceHighVariance * *((float *)&a1->m_nZOrder + v13->m_varianceIndex + 1097);
m_speedRangeLowVariance = m_gameObject->m_speedRangeLowVariance;
v91 = 0.0;
if ( m_speedRangeLowVariance != 0.0 )
v91 = m_speedRangeLowVariance * *((float *)&a1->m_uOrderOfArrival + v13->m_varianceIndex + 1097);
m_speedRangeHighVariance = m_gameObject->m_speedRangeHighVariance;
v93 = m_gameObject->m_speedRangeLow + v91;
v94 = 0.0;
if ( m_speedRangeHighVariance != 0.0 )
v94 = m_speedRangeHighVariance * *((float *)&a1->m_unknown5 + v13->m_varianceIndex + 1097);
m_breakForceVariance = m_gameObject->m_breakForceVariance;
v96 = m_gameObject->m_speedRangeHigh + v94;
v97 = 0.0;
if ( m_breakForceVariance != 0.0 )
v97 = m_breakForceVariance * *(&a1->m_fRotationX + v13->m_varianceIndex + 1097);
m_breakAngleVariance = m_gameObject->m_breakAngleVariance;
v99 = 0.0;
v100 = (float)(m_gameObject->m_breakForce + v97) * 0.01;
if ( m_breakAngleVariance != 0.0 )
v99 = m_breakAngleVariance * *(&a1->m_fRotationY + v13->m_varianceIndex + 1097);
m_breakSteerForceVariance = m_gameObject->m_breakSteerForceVariance;
m_breakSteerForce = m_gameObject->m_breakSteerForce;
v129 = 0.0;
v102 = (float)(m_gameObject->m_breakAngle + v99) * 0.017453;
if ( m_breakSteerForceVariance != 0.0 )
v129 = m_breakSteerForceVariance * *(&a1->m_fScaleX + v13->m_varianceIndex + 1097);
m_breakSteerSpeedLimitVariance = m_gameObject->m_breakSteerSpeedLimitVariance;
v139 = 0.0;
m_breakSteerSpeedLimit = m_gameObject->m_breakSteerSpeedLimit;
if ( m_breakSteerSpeedLimitVariance != 0.0 )
v139 = m_breakSteerSpeedLimitVariance * *(&a1->m_fScaleX + v13->m_varianceIndex + 1097);
p_m_unkPoint1 = (float *)&v14->m_unkPoint1;
v104 = fabsf(
sqrtf(
(float)(v14->m_unkPoint1.y * v14->m_unkPoint1.y)
+ (float)(v14->m_unkPoint1.x * v14->m_unkPoint1.x)));
if ( v93 >= v104 && m_gameObject->m_steerForceLowEnabled )
{
v105 = (float)(m_gameObject->m_steerForceLow + v87) * 0.01;
}
else if ( v96 > 0.0 && m_gameObject->m_steerForceHighEnabled && v96 <= v104 )
{
v105 = (float)(m_gameObject->m_steerForceHigh + v89) * 0.01;
}
else
{
v105 = (float)(m_steerForce + v85) * 0.01;
}
v126 = v104;
v106 = atan2f(*((float *)&v151 + 1), *(float *)&v151);
v107 = atan2f(v14->m_unkPoint2.y, v14->m_unkPoint2.x);
v108 = GJBaseGameLayer::convertToClosestDirection(v106 - v107, 3.1416);
v109 = v108;
if ( v100 > 0.0 && v102 < fabsf(v108) && (float)(m_breakSteerSpeedLimit + v139) < v126 )
v105 = (float)(m_breakSteerForce + v129) * 0.01;
v110 = v14->m_unkFloat2 + (float)((float)(v105 - v14->m_unkFloat2) / 10.0);
v14->m_unkFloat2 = v110;
if ( v108 < 0.0 )
{
v110 = -v110;
if ( v108 <= v110 )
goto LABEL_146;
}
else if ( v108 >= v110 )
{
goto LABEL_146;
}
v110 = v108;
LABEL_146:
if ( v110 != 0.0 )
{
v140 = v108;
v130 = cosf(v110 * a4);
v111 = sinf(v110 * a4);
x = v14->m_unkPoint1.x;
y = v14->m_unkPoint1.y;
if ( !m_gameObject->m_xOnly )
v14->m_unkPoint1.y = (float)(v130 * y) + (float)(v111 * x);
if ( !m_gameObject->m_yOnly )
v14->m_unkPoint1.x = (float)(v130 * x) - (float)(v111 * y);
v114 = atan2f(v14->m_unkPoint2.y, v14->m_unkPoint2.x);
v154 = cocos2d::ccpForAngle((float)(v110 * a4) + v114);
cocos2d::CCPoint::operator=(p_m_unkPoint2, v154.x, v154.y);
v109 = v140;
}
if ( v100 <= 0.0 || (float)(vabds_f32(v109, v110) - v102) <= 0.0 )
goto LABEL_162;
v115 = v14->m_unkPoint1.x;
v116 = fabsf((float)(v100 * v14->m_unkPoint2.x) * a4);
if ( v115 < 0.0 )
{
v116 = -v116;
if ( v115 < v116 )
goto LABEL_156;
}
else if ( v116 < v115 )
{
goto LABEL_156;
}
v116 = v14->m_unkPoint1.x;
LABEL_156:
v117 = v14->m_unkPoint1.y;
v118 = fabsf((float)(v100 * v14->m_unkPoint2.y) * a4);
if ( v117 < 0.0 )
{
v118 = -v118;
if ( v117 < v118 )
{
LABEL_158:
if ( m_gameObject->m_xOnly )
goto LABEL_160;
LABEL_159:
v14->m_unkPoint1.y = v117 - v118;
goto LABEL_160;
}
}
else if ( v118 < v117 )
{
goto LABEL_158;
}
v118 = v14->m_unkPoint1.y;
if ( !m_gameObject->m_xOnly )
goto LABEL_159;
LABEL_160:
v33 = 0.0;
if ( !m_gameObject->m_yOnly )
v14->m_unkPoint1.x = v115 - v116;
LABEL_162:
v119 = &v14->m_unkPoint2;
if ( m_targetDirection )
v119 = (const cocos2d::CCPoint *)&v151;
cocos2d::CCPoint::CCPoint(&v152, v119);
if ( !m_gameObject->m_xOnly )
v14->m_unkPoint1.y = v14->m_unkPoint1.y + (float)((float)(v33 * v152.y) * a4);
if ( !m_gameObject->m_yOnly )
v14->m_unkPoint1.x = v14->m_unkPoint1.x + (float)((float)(v33 * v152.x) * a4);
v136 = 0;
LABEL_48:
if ( m_rotateDirection )
{
v57 = (float)(90.0 - (float)(atan2f(p_m_unkPoint2[1], *p_m_unkPoint2) * 57.296))
+ m_gameObject->m_rotationOffset;
v58 = v13->getRotation(v13);
v44 = GJBaseGameLayer::convertToClosestDirection(v57 - v58, 180.0) * 0.25;
v138 = v44 != 0.0;
}
else
{
v44 = 0.0;
v138 = 0;
}
v45 = m_maxSpeed + v20;
v46 = sqrtf((float)(p_m_unkPoint1[1] * p_m_unkPoint1[1]) + (float)(*p_m_unkPoint1 * *p_m_unkPoint1));
if ( m_gameObject->m_xOnly )
{
v47 = v14->m_unkPoint1.x;
v48 = fabsf(v47);
if ( v45 < v48 && v45 > 0.0 )
v14->m_unkPoint1.x = (float)(v45 / v48) * v47;
}
else if ( m_gameObject->m_yOnly )
{
v55 = v14->m_unkPoint1.y;
v56 = fabsf(v55);
if ( v45 < v56 && v45 > 0.0 )
v14->m_unkPoint1.y = v55 * (float)(v45 / v56);
}
else if ( v45 < v46 && v45 > 0.0 )
{
cocos2d::CCPoint::operator*(p_m_unkPoint1, v45 / v46);
cocos2d::CCPoint::operator=(p_m_unkPoint1, v66, v67);
}
cocos2d::CCPoint::CCPoint(&v149, &stru_1242DA8);
if ( v136 )
v49 = 1.0;
else
v49 = a4;
cocos2d::CCPoint::operator*(p_m_unkPoint1, v49);
if ( m_gameObject->m_xOnly )
{
v50 = 0.0;
v51 = v150.x;
v150.y = 0.0;
if ( v150.x == 0.0 )
goto LABEL_60;
}
else
{
if ( m_gameObject->m_yOnly )
{
v51 = 0.0;
v150.x = 0.0;
}
else
{
v51 = v150.x;
if ( v150.x != 0.0 )
goto LABEL_58;
}
v50 = v150.y;
if ( v150.y == 0.0 )
goto LABEL_60;
}
LABEL_58:
if ( i != 1 )
{
GJBaseGameLayer::moveObject(a1, v13, v51, v150.y, 0);
LABEL_60:
if ( !v138 )
goto LABEL_63;
if ( i )
goto LABEL_62;
GJBaseGameLayer::rotateObject(a1, v13, v44);
goto LABEL_63;
}
if ( v138 )
{
cocos2d::CCPoint::operator=(&v149, v51, v50);
v123 = GJBaseGameLayer::getTargetGroup(a1, v135, v13->m_uniqueID);
GJBaseGameLayer::moveObjects(a1, v123, v150.x, v150.y, 0);
LABEL_62:
v52 = GJBaseGameLayer::getTargetGroup(a1, v135, v13->m_uniqueID);
GameObject::getUnmodifiedPosition(v13);
cocos2d::CCPoint::CCPoint(&v152, &v149);
GJBaseGameLayer::rotateObjects(a1, v52, v44, v155, v156, (bool)&v151, (bool)&v152);
goto LABEL_63;
}
v122 = GJBaseGameLayer::getTargetGroup(a1, v135, v13->m_uniqueID);
GJBaseGameLayer::moveObjects(a1, v122, v150.x, v150.y, 0);
LABEL_63:
if ( v12 >= (char *)++arr )
{
v13 = *arr;
if ( *arr )
continue;
}
goto LABEL_65;
}
m_steerForceVariance = m_gameObject->m_steerForceVariance;
m_steerForce = m_gameObject->m_steerForce;
v85 = 0.0;
if ( m_steerForceVariance == 0.0 )
goto LABEL_121;
LABEL_120:
v85 = m_steerForceVariance * *((float *)&a1->m_uUnknown + v13->m_varianceIndex + 1097);
goto LABEL_121;
}
}
}
}
LABEL_65:
;
}
}