//
// GJBaseGameLayer::checkCollisions from 0x100125800 to 0x100126906 (4358 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::update @ 0x1001523e7
// > GJBaseGameLayer::update @ 0x10015247b
//
// 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
//
int __fastcall GJBaseGameLayer::checkCollisions(GJBaseGameLayer *a1, PlayerObject *a2, float a3, bool a4)
{
PlayerObject *v5; // r14
GJBaseGameLayer *v6; // rbx
bool m_wasTeleported; // r13
__m128 m_vehicleSize_low; // xmm4
float m_unkAngle1; // xmm3_4
__m128 v10; // xmm0
double v11; // xmm1_8
__m128 v12; // xmm4
float v13; // xmm3_4
float v14; // xmm0_4
bool v15; // zf
char m_isDualMode; // r15
bool m_isOutOfBounds; // al
PlayerObject *v18; // rdi
__int64 v19; // rax
__int64 v20; // rax
GJBaseGameLayer *v21; // rcx
float v22; // xmm3_4
bool isSafeFlip; // al
__int64 v24; // rdx
float *v25; // rax
int v26; // ebx
float *v27; // rax
float y; // xmm1_4
float m_cameraZoom; // xmm0_4
__int64 v30; // rax
float v31; // xmm1_4
bool v32; // r13
__int64 v33; // rax
__int64 v34; // rax
GLubyte v35; // r12
PlayerObject *v36; // rbx
PlayerObject *v37; // r14
bool canStickToGround; // al
bool v39; // r15
__int64 v40; // rax
__int64 v41; // rax
PlayerObject *v42; // rbx
__int64 v43; // rax
float v44; // xmm0_4
__int64 v45; // rax
float *v46; // rax
bool *p_m_wasOnSlope; // rbx
float v48; // xmm0_4
double v49; // xmm0_8
double v50; // xmm1_8
double v51; // xmm0_8
PlayerObject *v52; // rbx
double v53; // xmm0_8
bool v54; // r15
GJBaseGameLayer *v55; // rdi
GJBaseGameLayer_vtbl *v56; // rax
PlayerObject *v57; // rsi
GameObject *v58; // rdx
bool v59; // al
float *v60; // rax
float v61; // xmm0_4
double v62; // xmm0_8
PlayerObject *v63; // r14
float v64; // xmm0_4
float *v65; // rax
int v66; // ebx
float v67; // xmm0_4
__int64 v68; // rax
int v69; // ecx
unsigned int v70; // eax
unsigned __int64 v71; // r10
GJBaseGameLayer *v72; // rdi
__int64 end; // rdx
signed __int64 begin; // rsi
__int64 v75; // r9
unsigned __int64 v76; // r8
unsigned int v77; // r9d
__int64 v78; // r8
__int64 v79; // rcx
std::vector *, std::allocator *>> *v80; // rax
__int64 v81; // rsi
unsigned __int64 v82; // rax
unsigned __int64 v83; // r13
std::__vector_base::pointer v84; // rax
std::vector *v85; // r15
unsigned __int64 v86; // rbx
__int64 v87; // rax
unsigned __int64 *v88; // rdi
unsigned __int64 *v89; // rsi
unsigned __int64 v90; // rcx
__int64 v91; // rcx
std::__vector_base::pointer v92; // rax
__int64 v93; // rcx
unsigned __int64 v94; // rdx
__int64 m_calcNonEffectObjectsSize; // rcx
__int64 v96; // rbx
double v97; // xmm0_8
double v98; // xmm0_8
double v99; // xmm0_8
double v100; // xmm0_8
GJBaseGameLayer *v101; // rcx
int m_solidCollisionObjectsCount; // eax
int v103; // r12d
int v104; // r13d
GameObject *v105; // rbx
int v106; // eax
double v107; // xmm0_8
double v108; // xmm0_8
double v109; // xmm0_8
double v110; // xmm0_8
__int64 v111; // rax
double v112; // xmm0_8
double v113; // xmm0_8
double v114; // xmm0_8
double v115; // xmm0_8
PlayerObject *m_player1; // rdi
__int64 v117; // rax
double v118; // xmm0_8
double v119; // xmm0_8
double v120; // xmm0_8
double v121; // xmm0_8
GJBaseGameLayer *v122; // rcx
__int64 v123; // r14
GameObject *v124; // r13
PlayerObject *v125; // r15
const cocos2d::CCPoint *v126; // rbx
__int64 v127; // rax
double v128; // xmm0_8
double v129; // xmm0_8
double v130; // xmm0_8
double v131; // xmm0_8
OBB2D *v132; // rbx
OBB2D *v133; // r15
bool v135; // [rsp+4h] [rbp-8Ch]
bool (__fastcall *v136)(__int64, __int64); // [rsp+8h] [rbp-88h] BYREF
__m128 v137; // [rsp+10h] [rbp-80h]
float v138; // [rsp+2Ch] [rbp-64h]
unsigned __int64 v139; // [rsp+30h] [rbp-60h]
unsigned __int64 v140; // [rsp+38h] [rbp-58h]
PlayerObject *v141; // [rsp+40h] [rbp-50h]
unsigned __int64 v142; // [rsp+48h] [rbp-48h]
double YVelocity; // [rsp+50h] [rbp-40h]
GJBaseGameLayer *v144; // [rsp+58h] [rbp-38h]
signed __int64 v145; // [rsp+60h] [rbp-30h]
v138 = a3;
v5 = a2;
v6 = a1;
m_wasTeleported = a2->m_wasTeleported;
a2->m_wasTeleported = 0;
PlayerObject::preCollision(a2);
m_vehicleSize_low = (__m128)LODWORD(a2->m_vehicleSize);
m_unkAngle1 = a2->m_unkAngle1;
v10 = (__m128)0x3F800000u;
*(_QWORD *)&v11 = 1056964608;
v10.f32[0] = (float)((float)(1.0 - m_vehicleSize_low.f32[0]) * m_unkAngle1) * 0.5;
v12 = _mm_and_ps(_mm_cmpneq_ss(m_vehicleSize_low, (__m128)0x3F800000u), v10);
v13 = m_unkAngle1 * 0.5;
*(float *)&YVelocity = v13;
v14 = v13 + 90.0;
v15 = !a1->m_gameState.m_isFreeMode;
v144 = a1;
v137 = v12;
if ( v15 )
{
*(float *)&v145 = v13 + 90.0;
m_isDualMode = 1;
if ( PlayerObject::isFlying(a2) || a2->m_isBall )
{
v6 = v144;
v12.i32[0] = v137.i32[0];
v14 = *(float *)&v145;
}
else
{
v6 = v144;
v12.i32[0] = v137.i32[0];
v14 = *(float *)&v145;
if ( !a2->m_isSpider )
m_isDualMode = v144->m_gameState.m_isDualMode;
}
}
else
{
m_isDualMode = 0;
}
m_isOutOfBounds = a2->m_isOutOfBounds;
a2->m_isOutOfBounds = 0;
v15 = !v6->m_isPlatformer;
LOBYTE(v139) = m_isOutOfBounds;
*(float *)&v145 = v14 - v12.f32[0];
if ( !v15 )
{
if ( *(float *)((__int64 (__fastcall *)(PlayerObject *))a2->getPosition)(a2) < -30.0 )
{
a2->m_platformerXVelocity = 0.0;
*(_QWORD *)&v11 = *(unsigned int *)(((__int64 (__fastcall *)(PlayerObject *))a2->getPosition)(a2) + 4);
sub_10028CBE0(&v136, -30.0, *(float *)&v11);
v18 = a2;
a2 = (PlayerObject *)&v136;
((void (__fastcall *)(PlayerObject *, bool (__fastcall **)(__int64, __int64)))v5->setPosition)(v18, &v136);
}
goto LABEL_12;
}
if ( !a2->m_isGoingLeft || *(float *)((__int64 (__fastcall *)(PlayerObject *))a2->getPosition)(a2) >= -30.0 )
{
LABEL_12:
LODWORD(v6) = 0;
goto LABEL_13;
}
LOBYTE(v6) = 1;
LABEL_13:
v19 = ((__int64 (__fastcall *)(PlayerObject *))v5->getPosition)(v5);
if ( *(float *)&v145 <= *(float *)(v19 + 4)
|| m_isDualMode && (PlayerObject::isFlying(v5) || v5->m_isBall || v144->m_gameState.m_isDualMode || v5->m_isSpider) )
{
v20 = ((__int64 (__fastcall *)(PlayerObject *))v5->getPosition)(v5);
v21 = v144;
v22 = v137.f32[0];
if ( *(float *)(v20 + 4) > (float)(v144->m_maxGameplayY + v137.f32[0]) )
LOBYTE(v6) = 1;
}
else if ( v5->m_isUpsideDown )
{
isSafeFlip = PlayerObject::isSafeFlip(v5, 0.1);
LOBYTE(v6) = 1;
v21 = v144;
v22 = v137.f32[0];
if ( isSafeFlip )
{
v25 = (float *)((__int64 (__fastcall *)(PlayerObject *, PlayerObject *, __int64, GJBaseGameLayer *, float, double, double, double))v5->getPosition)(
v5,
a2,
v24,
v144,
0.1,
v11,
COERCE_DOUBLE(1065353216),
*(double *)v137.i64);
sub_10028CBE0(&v136, *v25, *(float *)&v145);
((void (__fastcall *)(PlayerObject *, bool (__fastcall **)(__int64, __int64)))v5->setPosition)(v5, &v136);
v26 = 0;
PlayerObject::hitGround(v5, nullptr, 1);
PlayerObject::updateCollide(v5, (PlayerCollisionDirection)0, nullptr);
v5->m_isOnGround2 = 0;
return v26;
}
}
else
{
if ( !v5->m_maybeIsBoosted )
{
v27 = (float *)((__int64 (__fastcall *)(PlayerObject *))v5->getPosition)(v5);
sub_10028CBE0(&v136, *v27, *(float *)&v145);
((void (__fastcall *)(PlayerObject *, bool (__fastcall **)(__int64, __int64)))v5->setPosition)(v5, &v136);
PlayerObject::hitGround(v5, nullptr, 0);
PlayerObject::updateCollide(v5, (PlayerCollisionDirection)1, nullptr);
}
v21 = v144;
v22 = v137.f32[0];
}
v141 = v5;
v135 = a4;
if ( !m_isDualMode || m_wasTeleported )
goto LABEL_54;
y = v21->m_gameState.m_unkPoint17.y;
if ( y == 0.0 || v21->m_gameState.m_unkBool1 )
{
m_cameraZoom = v21->m_gameState.m_cameraZoom;
*(float *)&v145 = (float)(*(float *)&v21->m_gameState.m_unkInt11 / m_cameraZoom)
+ fmaxf(
(float)((float)((float)(-0.5 * *(float *)&v21->m_gameState.m_unkInt11) / m_cameraZoom)
+ *(float *)&v21->m_gameState.m_unkInt14)
+ v21->m_gameState.m_cameraOffset.y,
90.0);
if ( y == 0.0 )
goto LABEL_35;
}
else
{
*(float *)&v145 = v21->m_gameState.m_cameraPosition2.y;
v30 = ((__int64 (__fastcall *)(GJGroundLayer *))v21->m_groundLayer2->getPosition)(v21->m_groundLayer2);
v22 = v137.f32[0];
v21 = v144;
m_cameraZoom = v144->m_gameState.m_cameraZoom;
v31 = v144->m_gameState.m_unkPoint17.y;
*(float *)&v145 = (float)((float)(*(float *)(v30 + 4) + 1.0) / m_cameraZoom) + *(float *)&v145;
if ( v31 == 0.0 )
{
LABEL_35:
LODWORD(v142) = fmaxf(
(float)((float)((float)(*(float *)&v21->m_gameState.m_unkInt11 * -0.5) / m_cameraZoom)
+ *(float *)&v21->m_gameState.m_unkInt14)
+ v21->m_gameState.m_cameraOffset.y,
90.0);
goto LABEL_36;
}
}
if ( v21->m_gameState.m_unkBool1 )
goto LABEL_35;
*(float *)&v142 = v21->m_gameState.m_cameraPosition2.y;
v43 = ((__int64 (__fastcall *)(GJGroundLayer *))v21->m_groundLayer->getPosition)(v21->m_groundLayer);
v22 = v137.f32[0];
v21 = v144;
v44 = (float)((float)(*(float *)(v43 + 4) + -1.0) / v144->m_gameState.m_cameraZoom) + *(float *)&v142;
LODWORD(v142) = 1119092736;
if ( v44 > 90.0 )
{
*(float *)&v142 = v144->m_gameState.m_cameraPosition2.y;
v45 = ((__int64 (__fastcall *)(GJGroundLayer *, float, float, double, double))v144->m_groundLayer->getPosition)(
v144->m_groundLayer,
*(float *)&v142,
90.0,
0.0,
*(double *)v137.i64);
v22 = v137.f32[0];
v21 = v144;
*(float *)&v142 = (float)((float)(*(float *)(v45 + 4) + -1.0) / v144->m_gameState.m_cameraZoom) + *(float *)&v142;
}
LABEL_36:
v32 = v5->m_isShip && v5->m_jumpBuffered;
*(float *)&v140 = *(float *)&v145 - v21->m_gameState.m_unkUint17;
*(float *)&v145 = (float)(*(float *)&v145 - *(float *)&YVelocity) + v22;
v33 = ((__int64 (__fastcall *)(PlayerObject *))v5->getPosition)(v5);
if ( *(float *)(v33 + 4) > *(float *)&v145 )
{
v137.i32[0] = (int)v6;
if ( !v5->m_wasOnSlope
|| (v34 = ((__int64 (__fastcall *)(PlayerObject *))v141->getPosition)(v141),
v35 = 1,
*(float *)(v34 + 4) <= (float)(*(float *)&YVelocity + *(float *)&v145)) )
{
v36 = v141;
if ( !PlayerObject::destroyFromHitHead(v141) || v36->m_isUpsideDown )
{
v35 = 0;
goto LABEL_45;
}
v35 = 1;
if ( PlayerObject::isSafeHeadTest(v36) )
{
LABEL_45:
v37 = v141;
YVelocity = PlayerObject::getYVelocity(v141);
if ( v37->m_isUpsideDown )
{
canStickToGround = PlayerObject::canStickToGround(v37);
v39 = canStickToGround && *(float *)&v140 != 0.0;
}
else
{
v39 = 0;
}
v46 = (float *)((__int64 (__fastcall *)(PlayerObject *))v37->getPosition)(v37);
sub_10028CBE0(&v136, *v46, *(float *)&v145);
((void (__fastcall *)(PlayerObject *, bool (__fastcall **)(__int64, __int64)))v37->setPosition)(v37, &v136);
if ( v35 )
{
PlayerObject::pushDown(v37);
}
else if ( PlayerObject::getYVelocity(v37) > 0.0 )
{
PlayerObject::hitGround(v37, nullptr, !v37->m_isUpsideDown);
}
p_m_wasOnSlope = &v37->m_wasOnSlope;
v48 = YVelocity;
*(float *)&v145 = v48;
PlayerObject::updateCollide(v37, (PlayerCollisionDirection)v37->m_isUpsideDown, nullptr);
if ( !v39
|| (YVelocity = *(float *)&v145, v49 = PlayerObject::getYVelocity(v37), v50 = YVelocity, YVelocity <= v49) )
{
if ( v32 && !v37->m_isUpsideDown && *(float *)&v140 > 0.0 )
{
v51 = *(float *)&v145;
LABEL_95:
PlayerObject::setYVelocity(v37, v51, 0);
}
LABEL_96:
*p_m_wasOnSlope = 0;
v35 = v137.i8[0];
if ( !(_BYTE)v139 )
goto LABEL_97;
goto LABEL_75;
}
goto LABEL_91;
}
}
goto LABEL_74;
}
*(float *)&v142 = (float)(*(float *)&v142 + *(float *)&YVelocity) - v137.f32[0];
v40 = ((__int64 (__fastcall *)(PlayerObject *))v5->getPosition)(v5);
if ( *(float *)&v142 <= *(float *)(v40 + 4) )
{
LABEL_54:
v35 = (unsigned __int8)v6;
if ( !(_BYTE)v139 )
goto LABEL_97;
goto LABEL_75;
}
v137.i32[0] = (int)v6;
if ( !v5->m_wasOnSlope
|| (v41 = ((__int64 (__fastcall *)(PlayerObject *))v141->getPosition)(v141),
v35 = 1,
(float)(*(float *)&v142 - *(float *)&YVelocity) <= *(float *)(v41 + 4)) )
{
v42 = v141;
if ( PlayerObject::destroyFromHitHead(v141) && v42->m_isUpsideDown )
{
v35 = 1;
if ( !PlayerObject::isSafeHeadTest(v42) )
goto LABEL_74;
}
else
{
v35 = 0;
}
v52 = v141;
v53 = PlayerObject::getYVelocity(v141);
v15 = !v52->m_isUpsideDown;
YVelocity = v53;
if ( v15 )
{
v59 = PlayerObject::canStickToGround(v52);
v54 = v59 && *(float *)&v140 != 0.0;
}
else
{
v54 = 0;
}
LODWORD(v145) = 0;
if ( !v35
&& !PlayerObject::canStickToGround(v141)
&& v144->m_gameState.m_cameraZoom != v144->m_gameState.m_targetCameraZoom )
{
LODWORD(v145) = 1065353216;
}
v37 = v141;
v60 = (float *)((__int64 (__fastcall *)(PlayerObject *))v141->getPosition)(v141);
sub_10028CBE0(&v136, *v60, *(float *)&v142 + *(float *)&v145);
((void (__fastcall *)(PlayerObject *, bool (__fastcall **)(__int64, __int64)))v37->setPosition)(v37, &v136);
if ( v35 )
{
PlayerObject::pushDown(v37);
}
else if ( !v37->m_isShip && !v37->m_isSwing || PlayerObject::getYVelocity(v37) < 0.0 )
{
PlayerObject::hitGround(v37, nullptr, v37->m_isUpsideDown);
}
p_m_wasOnSlope = &v37->m_wasOnSlope;
v61 = YVelocity;
*(float *)&v145 = v61;
PlayerObject::updateCollide(v37, (PlayerCollisionDirection)!v37->m_isUpsideDown, nullptr);
if ( !v54 || (YVelocity = *(float *)&v145, v62 = PlayerObject::getYVelocity(v37), v50 = YVelocity, v62 <= YVelocity) )
{
if ( v37->m_isUpsideDown && v32 && *(float *)&v140 < 0.0 )
{
v51 = *(float *)&v145;
goto LABEL_95;
}
goto LABEL_96;
}
LABEL_91:
v51 = v50;
goto LABEL_95;
}
LABEL_74:
if ( !(_BYTE)v139 )
{
LABEL_97:
v63 = v141;
v141->m_isOutOfBounds = v35;
v64 = 0.0;
if ( *(float *)((__int64 (__fastcall *)(PlayerObject *))v63->getPosition)(v63) > 0.0 )
{
if ( *(float *)((__int64 (__fastcall *)(PlayerObject *))v63->getPosition)(v63) >= 10000000.0 )
{
v64 = v144->m_sectionXFactor * 10000000.0;
}
else
{
v65 = (float *)((__int64 (__fastcall *)(PlayerObject *))v63->getPosition)(v63);
v64 = *v65 * v144->m_sectionXFactor;
}
}
v66 = (int)v64;
v67 = 0.0;
if ( *(float *)(((__int64 (__fastcall *)(PlayerObject *))v63->getPosition)(v63) + 4) > 0.0 )
{
if ( *(float *)(((__int64 (__fastcall *)(PlayerObject *))v63->getPosition)(v63) + 4) >= 10000000.0 )
{
v67 = v144->m_sectionYFactor * 10000000.0;
}
else
{
v68 = ((__int64 (__fastcall *)(PlayerObject *))v63->getPosition)(v63);
v67 = *(float *)(v68 + 4) * v144->m_sectionYFactor;
}
}
v69 = (int)v67;
v70 = 1;
if ( v66 >= 2 )
v70 = v66;
v71 = v66 + 1;
v72 = v144;
end = (__int64)v144->m_nonEffectObjects.__end_;
begin = (signed __int64)v144->m_nonEffectObjects.__begin_;
v75 = (end - begin) >> 3;
v76 = v75 - 1;
v77 = v75 - 1;
if ( v76 < v71 )
v71 = v77;
v139 = v71;
v78 = 1;
if ( v69 >= 2 )
v78 = (unsigned int)v69;
v144->m_solidCollisionObjectsCount = 0;
v72->m_hazardCollisionObjectsCount = 0;
if ( end != begin )
{
end = v70 - 1;
if ( (int)end <= (int)v139 )
{
v142 = v69 + 1;
v79 = (unsigned int)v78;
v78 = (unsigned int)(v78 - 1);
LODWORD(YVelocity) = v78;
v140 = v79 - 1;
end = v70 - 1LL;
v139 = (unsigned int)(v139 + 1);
do
{
v80 = v72->m_nonEffectObjects.__begin_[end];
if ( v80 )
{
v81 = v80->__end_ - v80->__begin_;
v82 = v81 - 1;
begin = (unsigned int)(v81 - 1);
if ( v82 >= v142 )
begin = (unsigned int)v142;
v145 = begin;
if ( SLODWORD(YVelocity) <= (int)begin )
{
v145 = (unsigned int)(v145 + 1);
v83 = v140;
v137.i64[0] = end;
do
{
v85 = v72->m_nonEffectObjects.__begin_[end]->__begin_[v83];
if ( v85 )
{
v86 = v72->m_nonEffectObjectsSizes.__begin_[end]->__begin_[v83];
v87 = *(_QWORD *)&v72->m_nonEffectObjectsFlags.__begin_[end]->__begin_[8 * (v83 >> 6)];
if ( _bittest64(&v87, v83) )
{
v88 = (unsigned __int64 *)v85->__begin_;
v89 = (unsigned __int64 *)&v85->__begin_[v86];
v136 = sub_10010DD70;
_BitScanReverse64(&v90, v86);
v91 = (2 * ((unsigned int)v90 ^ 0x3F)) ^ 0x7ELL;
if ( !(_DWORD)v86 )
v91 = 0;
sub_100105F90(v88, v89, (unsigned __int8 (__fastcall **)(unsigned __int64 *))&v136, v91, 1);
v72 = v144;
if ( (int)v86 > 0 )
{
v92 = v85->__begin_;
if ( (unsigned int)v86 >= 8 )
{
v93 = 0;
do
{
v92[v93]->m_innerSectionIndex = v93;
v92[v93 + 1]->m_innerSectionIndex = v93 + 1;
v92[v93 + 2]->m_innerSectionIndex = v93 + 2;
v92[v93 + 3]->m_innerSectionIndex = v93 + 3;
v92[v93 + 4]->m_innerSectionIndex = v93 + 4;
v92[v93 + 5]->m_innerSectionIndex = v93 + 5;
v92[v93 + 6]->m_innerSectionIndex = v93 + 6;
v92[v93 + 7]->m_innerSectionIndex = v93 + 7;
v93 += 8;
}
while ( v93 != (v86 & 0x7FFFFFF8) );
}
else
{
v93 = 0;
}
v94 = v86 & 7;
if ( (v86 & 7) != 0 )
{
do
{
v92[v93]->m_innerSectionIndex = v93;
++v93;
--v94;
}
while ( v94 );
}
}
v84 = v72->m_nonEffectObjectsFlags.__begin_[v137.i64[0]]->__begin_;
*(_QWORD *)&v84[8 * (v83 >> 6)] &= ~(1LL << v83);
}
v63 = v141;
begin = (signed __int64)v141;
GJBaseGameLayer::collisionCheckObjects(v72, v141, v85, v86, v138);
v72 = v144;
end = v137.i64[0];
}
++v83;
}
while ( v83 != v145 );
}
}
++end;
}
while ( end != v139 );
}
}
m_calcNonEffectObjectsSize = (unsigned int)v72->m_calcNonEffectObjectsSize;
if ( (int)m_calcNonEffectObjectsSize > 0 )
{
begin = (signed __int64)v63;
GJBaseGameLayer::collisionCheckObjects(v72, v63, &v72->m_calcNonEffectObjects, m_calcNonEffectObjectsSize, v138);
}
if ( v63->m_lastGroundObject )
LODWORD(v145) = v63->m_isCollidingWithSlope;
else
LODWORD(v145) = 0;
v96 = ((__int64 (__fastcall *)(PlayerObject *, signed __int64, __int64, __int64, __int64))v63->getObjectRect)(
v63,
begin,
end,
m_calcNonEffectObjectsSize,
v78);
v97 = sub_10028D230();
v137.i32[0] = LODWORD(v97);
v98 = sub_10028D270();
LODWORD(v139) = LODWORD(v98);
v99 = sub_10028D280();
LODWORD(YVelocity) = LODWORD(v99);
v140 = v96;
v100 = sub_10028D2C0();
LODWORD(v142) = LODWORD(v100);
v101 = v144;
m_solidCollisionObjectsCount = v144->m_solidCollisionObjectsCount;
if ( m_solidCollisionObjectsCount > 0 )
{
v103 = 0;
v104 = -1;
do
{
v105 = *(&v101->m_solidCollisionObjects.__begin_[v104] + m_solidCollisionObjectsCount);
if ( !GameObject::getGroupDisabled(v105) )
{
GameObject::getObjectRectPointer(v105);
if ( (v145 & 1) != 0 && v105->m_groupCount > 0 )
{
LOBYTE(v106) = !PlayerObject::testForMoving(v63, v138, v105);
LODWORD(v145) = v106;
}
v107 = sub_10028D270();
if ( *(float *)&v107 <= v137.f32[0] )
{
v108 = sub_10028D230();
if ( *(float *)&v139 <= *(float *)&v108 )
{
v109 = sub_10028D2C0();
if ( *(float *)&v109 <= *(float *)&YVelocity )
{
v110 = sub_10028D280();
if ( *(float *)&v142 <= *(float *)&v110 )
{
PlayerObject::collidedWithObject_1(v63, v138, v105);
v111 = ((__int64 (__fastcall *)(PlayerObject *))v63->getObjectRect)(v63);
sub_10028D1A0(v140, v111);
v112 = sub_10028D230();
v137.i32[0] = LODWORD(v112);
v113 = sub_10028D270();
LODWORD(v139) = LODWORD(v113);
v114 = sub_10028D280();
LODWORD(YVelocity) = LODWORD(v114);
v115 = sub_10028D2C0();
LODWORD(v142) = LODWORD(v115);
}
}
}
}
}
++v103;
v101 = v144;
m_solidCollisionObjectsCount = v144->m_solidCollisionObjectsCount;
--v104;
}
while ( v103 < m_solidCollisionObjectsCount );
}
m_player1 = v101->m_player1;
if ( m_player1->m_isDead )
PlayerObject::removePlacedCheckpoint(m_player1);
v117 = ((__int64 (__fastcall *)(PlayerObject *))v63->getObjectRect)(v63);
sub_10028D1A0(v140, v117);
v118 = sub_10028D230();
LODWORD(v145) = LODWORD(v118);
v119 = sub_10028D270();
LODWORD(YVelocity) = LODWORD(v119);
v120 = sub_10028D280();
LODWORD(v142) = LODWORD(v120);
v121 = sub_10028D2C0();
LODWORD(v140) = LODWORD(v121);
((void (__fastcall *)(PlayerObject *))v63->updateOrientedBox)(v63);
v122 = v144;
if ( v144->m_hazardCollisionObjectsCount <= 0 )
{
LABEL_176:
PlayerObject::postCollision(v141, v138, v122->m_isBetweenSteps);
return 0;
}
v123 = 0;
while ( 1 )
{
v124 = v122->m_hazardCollisionObjects.__begin_[v123];
if ( !GameObject::getGroupDisabled(v124) )
{
GameObject::getObjectRectPointer(v124);
if ( v124->m_objectRadius <= 0.0 )
{
v128 = sub_10028D270();
if ( *(float *)&v128 > *(float *)&v145 )
goto LABEL_156;
v129 = sub_10028D230();
if ( *(float *)&YVelocity > *(float *)&v129 )
goto LABEL_156;
v130 = sub_10028D2C0();
if ( *(float *)&v130 > *(float *)&v142 )
goto LABEL_156;
v131 = sub_10028D280();
if ( *(float *)&v140 > *(float *)&v131 )
goto LABEL_156;
}
else if ( v144->m_levelSettings->m_fixRadiusCollision )
{
v125 = v141;
v126 = (const cocos2d::CCPoint *)((__int64 (__fastcall *)(PlayerObject *))v141->getPosition)(v141);
((void (__fastcall *)(bool (__fastcall **)(__int64, __int64), GameObject *))v124->getRealPosition)(
&v136,
v124);
v137.i32[0] = cocos2d::ccpDistance(v126, (const cocos2d::CCPoint *)&v136);
LODWORD(v139) = GameObject::getObjectRadius(v124);
v127 = ((__int64 (__fastcall *)(PlayerObject *))v125->getObjectRect)(v125);
if ( (float)((float)(*(float *)(v127 + 8) * 0.5) + *(float *)&v139) < v137.f32[0] )
goto LABEL_156;
}
else if ( !GJBaseGameLayer::objectIntersectsCircle((GJBaseGameLayer *)v124, v141, v124) )
{
goto LABEL_156;
}
if ( !v124->m_shouldUseOuterOb
|| v144->m_levelSettings->m_fixRadiusCollision && v124->m_objectRadius > 0.0
|| (v132 = (OBB2D *)((__int64 (__fastcall *)(GameObject *))v124->getOrientedBox)(v124),
v133 = (OBB2D *)((__int64 (__fastcall *)(PlayerObject *))v141->getOrientedBox)(v141),
OBB2D::overlaps1Way(v132))
&& OBB2D::overlaps1Way(v133) )
{
v26 = 1;
if ( !v135 )
{
v55 = v144;
v56 = v144->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v57 = v141;
v58 = v124;
LABEL_175:
((void (__fastcall *)(GJBaseGameLayer *, PlayerObject *, GameObject *))v56->destroyPlayer)(v55, v57, v58);
}
return v26;
}
}
LABEL_156:
++v123;
v122 = v144;
if ( v123 >= v144->m_hazardCollisionObjectsCount )
goto LABEL_176;
}
}
LABEL_75:
if ( !v35 )
goto LABEL_97;
v26 = 1;
if ( !v135 )
{
v55 = v144;
v56 = v144->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v57 = v141;
v58 = nullptr;
goto LABEL_175;
}
return v26;
}