//
// PlayerObject::collidedWithObjectInternal from 0x345338 to 0x346772 (5178 bytes)
//
// 4 xrefs:
// > PlayerObject::preSlopeCollision @ 0x348432
// > PlayerObject::preSlopeCollision @ 0x3485c2
// > PlayerObject::handleRotatedCollisionInternal @ 0x34c43e
// > PlayerObject::collidedWithObject @ 0x34c56a
//
// 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
//
bool PlayerObject::collidedWithObjectInternal(PlayerObject *a1, float a2, GameObject *a3, cocos2d::CCRect a4, bool a5)
{
float x; // r7
_BOOL4 v8; // r3
_BOOL4 v9; // r3
GameObject *v10; // r5
const cocos2d::CCRect *v11; // r0
const cocos2d::CCRect *v12; // r1
double v13; // d13
double v14; // d10
double unk_584; // d8
const cocos2d::CCPoint *LastPosition; // r0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // r3
float y; // s16
float v19; // s17
float v20; // s18
float v21; // s15
_BOOL4 m_isUpsideDown; // r3
bool v23; // fzf
bool v24; // fnf
float v25; // s16
double v26; // d9
_BOOL4 m_isPlatformer; // r11
int v28; // r3
float v29; // s15
const cocos2d::CCPoint *(__fastcall *v30)(cocos2d::CCNode *__hidden); // r3
float *v31; // r0
cocos2d::CCPoint *p_m_lastPosition; // r3
float v33; // s15
int v34; // r0
float v35; // s30
const cocos2d::CCPoint *v36; // r0
float v37; // s18
double v38; // d15
float v39; // s22
double v40; // d11
_BOOL4 v41; // r3
float v42; // s28
float v43; // r0
double v44; // d9
float v45; // s29
double v46; // d12
std::_Hashtable, 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>::size_type M_element_count; // r3
_BOOL4 v48; // r9
std::__detail::_Hash_node_base *M_nxt; // r10
int v50; // r7
GameObject *v51; // r8
cocos2d::CCRect *v52; // r0
float v53; // s14
cocos2d::CCRect *v54; // r0
float v55; // s14
int v56; // r1
_BOOL4 v57; // r0
int v58; // r2
int v59; // r3
_BOOL4 v60; // r10
int m_isBall; // r9
int v62; // r8
double v63; // d10
double v64; // d15
GJBaseGameLayer *m_gameLayer; // r9
const cocos2d::CCPoint *v66; // r0
const cocos2d::CCPoint *v67; // r0
float v68; // s22
float v69; // s20
const cocos2d::CCPoint *v70; // r0
float v71; // s29
float v72; // s28
const cocos2d::CCPoint *v73; // r0
const cocos2d::CCPoint *(__fastcall *v74)(cocos2d::CCNode *__hidden); // r3
float v75; // s23
float v76; // s16
float v77; // s21
float v78; // s15
_BOOL4 v79; // r11
_BOOL4 v80; // r10
float v81; // s16
float v82; // s16
double v83; // d10
double v84; // d13
const cocos2d::CCPoint *v85; // r0
float v86; // s21
float v87; // s20
_BOOL4 v88; // r7
int v89; // r6
int v90; // r6
int v92; // r3
int m_uniqueID; // r2
double v94; // d10
GJBaseGameLayer *v95; // r0
void (__fastcall *v96)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r7
const cocos2d::CCPoint *v97; // r0
float v98; // s15
bool v99; // r2
double v100; // r2
void (__fastcall *v101)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r7
const cocos2d::CCPoint *v102; // r0
float v103; // s15
bool v104; // r2
double v105; // r2
GJBaseGameLayer *v106; // r7
void (__fastcall *v107)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r7
const cocos2d::CCPoint *v108; // r0
float v109; // s15
bool v110; // r2
PlayerObject *v111; // r0
float v112; // r1
PlayerObject *v113; // r0
float v114; // r1
void (__fastcall *v115)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r7
const cocos2d::CCPoint *v116; // r0
float v117; // s15
bool v118; // r2
float v119; // r1
PlayerObject *v120; // r0
double *p_m_groundYVelocity; // r3
int v122; // r2
void (__fastcall *v123)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r6
double v124; // d7
float v125; // s16
const cocos2d::CCPoint *v126; // r0
DashRingObject *v127; // r3
_BOOL4 m_platformerMovingLeft; // r3
void (__fastcall *v129)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r6
double v130; // d7
float v131; // s16
const cocos2d::CCPoint *v132; // r0
DashRingObject *m_dashRing; // r3
PlayerObject_vtbl *v134; // r3
void (__fastcall *v135)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r8
float v136; // r1
float v137; // s15
const cocos2d::CCPoint *v138; // r3
float v139; // s16
GJBaseGameLayer *v140; // r0
_BOOL4 m_maybeCanRunIntoBlocks; // r5
GameManager *v142; // r0
const cocos2d::CCPoint *v143; // r0
float v144; // s15
bool v145; // r2
double m_groundYVelocity; // r2
float v147; // s15
const cocos2d::CCPoint *v148; // r0
float v149; // s15
bool isFlying; // r2
double v151; // r2
PlayerObject *v152; // r0
float v153; // r1
float v154; // r2
float v155; // r3
int v156; // [sp+0h] [bp-CCh]
cocos2d::CCRect *v157; // [sp+Ch] [bp-C0h]
_BOOL4 m_isPassable; // [sp+10h] [bp-BCh]
int v159; // [sp+14h] [bp-B8h]
_BOOL4 v160; // [sp+18h] [bp-B4h]
int v161; // [sp+1Ch] [bp-B0h]
int v162; // [sp+1Ch] [bp-B0h]
void (__fastcall *v163)(PlayerObject *__hidden, const cocos2d::CCPoint *); // [sp+1Ch] [bp-B0h]
float v164; // [sp+1Ch] [bp-B0h]
int v165; // [sp+20h] [bp-ACh]
_BOOL4 v166; // [sp+24h] [bp-A8h]
int v167; // [sp+24h] [bp-A8h]
_BOOL4 m_holdingLeft; // [sp+28h] [bp-A4h]
_BOOL4 m_holdingRight; // [sp+2Ch] [bp-A0h]
double v170; // [sp+30h] [bp-9Ch]
double v171; // [sp+38h] [bp-94h]
_BOOL4 v172; // [sp+38h] [bp-94h]
double m_yVelocity; // [sp+40h] [bp-8Ch]
void (__fastcall *setPosition)(PlayerObject *__hidden, const cocos2d::CCPoint *); // [sp+40h] [bp-8Ch]
float v175; // [sp+48h] [bp-84h]
float v177; // [sp+50h] [bp-7Ch]
float v178; // [sp+54h] [bp-78h]
float v179; // [sp+58h] [bp-74h]
float height; // [sp+5Ch] [bp-70h]
int v181; // [sp+60h] [bp-6Ch]
float v182; // [sp+64h] [bp-68h]
float width; // [sp+68h] [bp-64h]
cocos2d::CCPoint v184; // [sp+74h] [bp-58h] BYREF
cocos2d::CCPoint v185; // [sp+7Ch] [bp-50h] BYREF
cocos2d::CCRect v186; // [sp+84h] [bp-48h] BYREF
cocos2d::CCRect v187; // [sp+94h] [bp-38h] BYREF
cocos2d::CCRect v188; // [sp+A4h] [bp-28h] BYREF
cocos2d::CCRect v189; // [sp+B4h] [bp-18h] BYREF
cocos2d::CCRect v190; // 0:kr00_16.16
x = a4.origin.x;
m_holdingLeft = a1->m_holdingLeft;
m_holdingRight = a1->m_holdingRight;
if ( a1->m_holdingLeft && a1->m_holdingRight )
{
v8 = a1->m_holdingLeft;
if ( !a1->m_leftPressedFirst )
v8 = 0;
m_holdingLeft = v8;
v9 = a1->m_holdingRight;
if ( a1->m_leftPressedFirst )
v9 = 0;
m_holdingRight = v9;
}
if ( cocos2d::CCRect::equals((cocos2d::CCRect *)LODWORD(x), &stru_AC5C70) )
v10 = a3;
else
v10 = nullptr;
v11 = a1->getObjectRect(a1);
cocos2d::CCRect::CCRect(&v186, v11);
if ( v10 )
v12 = v10->getObjectRect(v10);
else
v12 = (const cocos2d::CCRect *)LODWORD(x);
cocos2d::CCRect::CCRect(&v187, v12);
if ( !a1->m_isPlatformer || a1->m_wasOnSlope )
{
v13 = 10.0;
}
else
{
v13 = 10.0;
if ( !a1->m_isOnSlope )
v13 = 5.0;
}
if ( a1->m_stateScale > 0 )
v13 = 15.0;
v14 = v13 * (double)PlayerObject::flipMod(a1);
if ( PlayerObject::isFlying(a1) && !a1->m_isPlatformer )
v14 = (float)((float)PlayerObject::flipMod(a1) * 6.0);
if ( a1->m_wasOnSlope )
{
unk_584 = a1->unk_584;
v14 = v14 + unk_584 * (double)PlayerObject::flipMod(a1);
}
if ( v10 )
m_isPassable = v10->m_isPassable;
else
m_isPassable = 0;
if ( a3 )
{
if ( a2 <= 0.0 )
goto LABEL_62;
LastPosition = GameObject::getLastPosition(a3);
cocos2d::CCPoint::CCPoint(&v185, LastPosition);
a3->getRealPosition((cocos2d::CCPoint *)&v188, a3);
getPosition = a1->getPosition;
y = v185.y;
v19 = v188.origin.y;
if ( a1->m_isSideways )
{
v19 = v188.origin.x;
y = v185.x;
v20 = getPosition(a1)->x;
}
else
{
v20 = getPosition(a1)->y;
}
if ( a1->m_isSideways )
{
GameObject::getScalePosDelta(&v189.origin, a3);
v21 = v189.origin.x;
}
else
{
GameObject::getScalePosDelta(&v189.origin, a3);
v21 = v189.origin.y;
}
if ( v21 != 0.0 )
{
if ( v20 >= v19 )
y = y - v21;
else
y = y + v21;
}
if ( v188.origin.x == v185.x && v188.origin.y == v185.y )
{
LABEL_62:
v25 = 0.0;
m_isPlatformer = 0;
v157 = nullptr;
v160 = 0;
}
else
{
m_isUpsideDown = a1->m_isUpsideDown;
v23 = y == v19;
v24 = y < v19;
if ( a1->m_isUpsideDown )
{
if ( v24 || v23 )
{
v25 = 0.0;
m_isPlatformer = v24;
m_isUpsideDown = 0;
goto LABEL_58;
}
}
else if ( y >= v19 )
{
m_isPlatformer = !v24 && !v23;
v25 = 0.0;
LABEL_58:
v157 = (cocos2d::CCRect *)m_isUpsideDown;
v160 = m_isUpsideDown;
goto LABEL_63;
}
v25 = (float)(v19 - y) / a2;
v26 = fabsf(v25);
v160 = v26 > 5.0;
v14 = v14 + v26 * (double)PlayerObject::flipMod(a1);
if ( a1->m_isPlatformer )
{
m_isPlatformer = 0;
}
else
{
m_isPlatformer = a1->m_isPlatformer;
a1->m_groundYVelocity = v25;
}
v157 = (cocos2d::CCRect *)(&dword_0 + 1);
}
}
else
{
v25 = 0.0;
m_isPlatformer = 0;
v157 = nullptr;
v160 = 0;
}
LABEL_63:
v28 = a1->m_isPlatformer;
v29 = 0.0;
if ( a1->m_isPlatformer )
v29 = 5.0;
v175 = v29;
if ( a1->m_stateHitHead > 0 || a1->m_isPlatformer || a1->m_stateFlipGravity > 0 )
v28 = !m_isPassable;
v165 = v28;
v30 = a1->getPosition;
if ( a1->m_isSideways )
{
v31 = (float *)v30(a1);
p_m_lastPosition = &a1->m_lastPosition;
v33 = *v31;
}
else
{
v34 = (int)v30(a1);
p_m_lastPosition = (cocos2d::CCPoint *)&a1->m_lastPosition.y;
v33 = *(float *)(v34 + 4);
}
v35 = p_m_lastPosition->x;
a1->getPosition(a1);
v36 = a1->getPosition(a1);
v37 = v186.size.height * 0.5;
v38 = (float)(v33 - v35);
v39 = v36->y;
v40 = (float)(v39 - (float)(v37 * (float)PlayerObject::flipMod(a1))) + v14;
v170 = v40 - v38;
v179 = a1->getPosition(a1)->y;
height = v186.size.height;
v181 = PlayerObject::flipMod(a1);
a1->getPosition(a1);
if ( a1->m_isUpsideDown )
v41 = v38 < 0.0;
else
v41 = v38 > 0.0;
v166 = v41;
v177 = COERCE_FLOAT(cocos2d::CCRect::getMinX(&v187));
v178 = COERCE_FLOAT(cocos2d::CCRect::getMaxX(&v187));
v42 = COERCE_FLOAT(cocos2d::CCRect::getMaxY(&v187));
v43 = COERCE_FLOAT(cocos2d::CCRect::getMinY(&v187));
v44 = v42;
v182 = v187.origin.x;
width = v187.size.width;
v45 = v43;
v46 = v43;
if ( a1->m_isDart && a1->m_stateDartSlide <= 0 )
{
m_gameLayer = (GJBaseGameLayer *)(&dword_0 + 1);
v62 = 0;
goto LABEL_156;
}
if ( a1->m_isOnSlope || a1->m_wasOnSlope )
{
v48 = 1;
goto LABEL_82;
}
M_element_count = a1->m_potentialSlopeMap._M_h._M_element_count;
if ( M_element_count )
{
v48 = v10 == nullptr;
LABEL_82:
M_nxt = a1->m_potentialSlopeMap._M_h._M_before_begin._M_nxt;
v50 = 0;
v159 = 0;
v161 = 0;
while ( 1 )
{
if ( !M_nxt )
goto LABEL_110;
v51 = (GameObject *)M_nxt[2]._M_nxt;
if ( !v48 && v51 != a1->m_currentSlope )
{
v52 = (cocos2d::CCRect *)v51->getObjectRect(M_nxt[2]._M_nxt);
v53 = COERCE_FLOAT(cocos2d::CCRect::getMinX(v52));
if ( v53 >= v10->getPosition(v10)->x )
goto LABEL_103;
v54 = (cocos2d::CCRect *)v51->getObjectRect(v51);
v55 = COERCE_FLOAT(cocos2d::CCRect::getMaxX(v54));
if ( v55 <= v10->getPosition(v10)->x )
goto LABEL_103;
}
((void (__fastcall *)(cocos2d::CCRect *, GameObject *, int, int))v51->getObjectRect_0)(
&v188,
v51,
1067030938,
1066192077);
if ( !cocos2d::CCRect::intersectsRect(&v187, &v188) )
goto LABEL_103;
((void (__fastcall *)(cocos2d::CCRect *, GameObject *, int, int))v51->getObjectRect_0)(
&v189,
v51,
1067030938,
1066192077);
if ( !cocos2d::CCRect::intersectsRect(&v186, &v189) )
goto LABEL_103;
cocos2d::CCRect::CCRect(&v189, &v187);
LODWORD(v190.origin.x) = &v189;
v190.origin.y = v154;
v190.size.width = v155;
LODWORD(v190.size.height) = v156;
LODWORD(v171) = GameObject::slopeYPos(v51, v190);
HIDWORD(v171) = v56;
v57 = GameObject::slopeFloorTop(v51);
if ( v171 + 2.0 >= v44 )
{
if ( v57 )
{
v58 = v161;
if ( a1->m_currentSlope == v51 )
v58 = 1;
v59 = v58;
}
else
{
v59 = 1;
}
v161 = v59;
}
if ( v171 - 2.0 > v46 || !v57 && a1->m_currentSlope != v51 )
break;
if ( v161 )
{
M_element_count = 1;
v159 = 1;
goto LABEL_109;
}
v50 = 1;
v159 = 1;
LABEL_105:
M_nxt = M_nxt->_M_nxt;
}
v50 = 1;
LABEL_103:
if ( v161 && v159 )
goto LABEL_110;
goto LABEL_105;
}
v159 = 0;
v161 = 0;
LABEL_109:
v50 = M_element_count;
LABEL_110:
if ( v10 )
v60 = v10->getType(v10) == Breakable;
else
v60 = 0;
cocos2d::CCRect::CCRect(
&v188,
v186.origin.x + (float)(v175 * 0.5),
v186.origin.y,
v186.size.width - v175,
v186.size.height);
v172 = PlayerObject::isInNormalMode(a1);
if ( a1->m_isUpsideDown )
{
if ( PlayerObject::isFlying(a1) || a1->m_isBall )
m_isBall = !m_isPassable;
else
m_isBall = a1->m_isBall;
}
else
{
m_isBall = 1;
}
if ( a1->m_isUpsideDown )
{
if ( v40 < v44 && v170 < v44 )
goto LABEL_125;
}
else if ( v40 > v46 && v170 > v46 )
{
LABEL_125:
v62 = 0;
goto LABEL_129;
}
if ( a1->m_isPlatformer && v60 && v166 )
{
v62 = 1;
if ( !a1->m_maybeTouchedBreakableBlock )
{
v167 = 1;
goto LABEL_133;
}
}
else
{
v62 = 1;
}
LABEL_129:
v167 = 0;
LABEL_133:
if ( a1->m_isPlatformer )
{
if ( a1->m_isOnSlope || a1->m_wasOnSlope )
{
if ( v62 )
{
if ( !a1->m_maybeUpsideDownSlope )
v50 = 0;
}
else if ( a1->m_maybeUpsideDownSlope )
{
v50 = 0;
}
}
if ( !LOBYTE(a4.origin.y) && !cocos2d::CCRect::intersectsRect(&v188, &v187) )
goto LABEL_210;
}
v63 = (float)(v179 - (float)((float)(height * 0.5) * (float)-v181)) - v14;
v64 = v63 - v38;
if ( !m_isBall && !v165 )
goto LABEL_149;
if ( !a1->m_isUpsideDown )
{
if ( v40 < v44 && v170 < v44 )
goto LABEL_149;
goto LABEL_300;
}
if ( v63 >= v44 || v64 >= v44 )
{
if ( a1->m_isBird && v60 && !a1->m_isPlatformer )
{
((void (__fastcall *)(cocos2d::CCRect *, PlayerObject *, int, int))a1->getObjectRect_0)(
&v189,
a1,
1050253722,
1050253722);
if ( cocos2d::CCRect::intersectsRect(&v187, &v189) )
goto LABEL_231;
LABEL_389:
m_gameLayer = nullptr;
goto LABEL_150;
}
LABEL_300:
m_yVelocity = a1->m_yVelocity;
if ( m_yVelocity > 0.0 && !a1->m_wasOnSlope && !v160 || v50 && v161 )
{
if ( a1->m_isUpsideDown )
{
if ( v62 && m_isPlatformer )
{
v147 = m_yVelocity;
setPosition = a1->setPosition;
v164 = v147;
v148 = a1->getPosition(a1);
v149 = v44 + (float)(v186.size.height * 0.5);
cocos2d::CCPoint::CCPoint(&v189.origin, v148->x, v149);
setPosition(a1, &v189.origin);
isFlying = a1->m_isUpsideDown;
if ( isFlying )
isFlying = PlayerObject::isFlying(a1);
PlayerObject::hitGroundNoJump(a1, v10, isFlying);
if ( !v60 && !m_isPassable )
PlayerObject::updateCollideTop(a1, v42, v10);
PlayerObject::setYVelocity(a1, v164, 27);
v151 = a1->m_yVelocity < a1->m_groundYVelocity + 1.0 ? a1->m_groundYVelocity + 1.0 : a1->m_yVelocity;
PlayerObject::setYVelocity(a1, v151, 28);
PlayerObject::didHitHead(a1);
if ( v167 )
{
m_gameLayer = a1->m_gameLayer;
a1->m_maybeTouchedBreakableBlock = 1;
if ( !m_gameLayer )
{
GameObject::destroyObject(v10);
goto LABEL_150;
}
GJBaseGameLayer::destroyObject(m_gameLayer, v10);
}
}
}
else if ( !v62 && v157 )
{
v163 = a1->setPosition;
v143 = a1->getPosition(a1);
v144 = v44 + (float)(v186.size.height * 0.5);
cocos2d::CCPoint::CCPoint(&v189.origin, v143->x, v144);
v163(a1, &v189.origin);
v145 = a1->m_isUpsideDown;
if ( v145 )
v145 = PlayerObject::isFlying(a1);
PlayerObject::hitGround(a1, v10, v145);
PlayerObject::updateCollideBottom(a1, v42, v10);
PlayerObject::updateLastGroundObject(a1, a3);
a1->m_groundYVelocity = v25;
PlayerObject::setYVelocity(a1, m_yVelocity, 25);
if ( a1->m_yVelocity < a1->m_groundYVelocity )
m_groundYVelocity = a1->m_groundYVelocity;
else
m_groundYVelocity = a1->m_yVelocity;
PlayerObject::setYVelocity(a1, m_groundYVelocity, 26);
}
goto LABEL_389;
}
if ( v62 && m_yVelocity * (double)PlayerObject::flipMod(a1) > 0.0 && a1->m_gameLayer )
PlayerObject::gameEventTriggered(a1, 6, 0);
v115 = a1->setPosition;
v116 = a1->getPosition(a1);
v117 = v44 + (float)(v186.size.height * 0.5);
cocos2d::CCPoint::CCPoint(&v189.origin, v116->x, v117);
v115(a1, &v189.origin);
if ( v172 )
PlayerObject::checkSnapJumpToObject(a1, v10);
if ( !v165 || m_isBall )
{
v118 = a1->m_isUpsideDown;
if ( v118 )
v118 = PlayerObject::isFlying(a1);
if ( v62 )
PlayerObject::hitGroundNoJump(a1, v10, v118);
else
PlayerObject::hitGround(a1, v10, v118);
}
else
{
PlayerObject::setYVelocity(a1, 0.0, 23);
}
if ( a1->m_isUpsideDown )
{
if ( !v62 )
{
v120 = a1;
v119 = v45;
goto LABEL_314;
}
if ( !v60 && !m_isPassable )
{
v153 = v42;
v152 = a1;
goto LABEL_404;
}
}
else
{
if ( !v62 )
{
v119 = v42;
v120 = a1;
LABEL_314:
PlayerObject::updateCollideBottom(v120, v119, v10);
PlayerObject::updateLastGroundObject(a1, a3);
a1->m_groundYVelocity = v25;
goto LABEL_315;
}
if ( !v60 && !m_isPassable )
{
v152 = a1;
v153 = v45;
LABEL_404:
PlayerObject::updateCollideTop(v152, v153, v10);
}
}
if ( a1->m_isPlatformer )
PlayerObject::exitPlatformerAnimateJump(a1);
LABEL_315:
if ( v172 && a1->m_stateNoAutoJump > 0 && a1->m_padRingRelated )
a1->m_jumpBuffered = 0;
if ( PlayerObject::isFlying(a1) && v157 )
{
if ( !v62 )
goto LABEL_319;
p_m_groundYVelocity = &a1->m_groundYVelocity;
v122 = 24;
goto LABEL_322;
}
LABEL_317:
if ( !v62 )
{
LABEL_319:
if ( !v167 )
{
LABEL_260:
LOBYTE(v90) = 1;
return v90;
}
a1->m_maybeTouchedBreakableBlock = 1;
LABEL_231:
v95 = a1->m_gameLayer;
if ( v95 )
GJBaseGameLayer::destroyObject(v95, v10);
else
GameObject::destroyObject(v10);
goto LABEL_260;
}
LABEL_318:
PlayerObject::didHitHead(a1);
goto LABEL_319;
}
LABEL_149:
m_gameLayer = (GJBaseGameLayer *)(&dword_0 + 1);
LABEL_150:
if ( a1->m_isUpsideDown || (PlayerObject::isFlying(a1) || a1->m_isBall) && !m_isPassable )
{
v92 = 1;
}
else
{
if ( !v165 )
goto LABEL_156;
v92 = 0;
}
v162 = v92;
if ( !m_gameLayer )
goto LABEL_258;
if ( a1->m_isUpsideDown )
{
v63 = v40;
v64 = v170;
}
if ( v10 )
m_uniqueID = v10->m_uniqueID;
else
m_uniqueID = 0;
if ( v63 <= v46 || v64 <= v46 )
{
if ( a1->m_isUpsideDown )
goto LABEL_221;
}
else
{
if ( a1->m_isUpsideDown )
{
if ( m_uniqueID != a1->m_unk50C )
{
LABEL_210:
m_gameLayer = (GJBaseGameLayer *)(&dword_0 + 1);
goto LABEL_156;
}
LABEL_221:
v94 = a1->m_yVelocity;
if ( v94 < 0.0 && (!a1->m_isPlatformer || a1->m_yVelocityRelated <= 0.0) && !a1->m_wasOnSlope && !v160
|| v50 && v159 )
{
if ( a1->m_isUpsideDown )
{
if ( !v62 && v157 )
{
v96 = a1->setPosition;
v97 = a1->getPosition(a1);
v98 = v46 - (float)(v186.size.height * 0.5);
cocos2d::CCPoint::CCPoint(&v189.origin, v97->x, v98);
v96(a1, &v189.origin);
v99 = a1->m_isUpsideDown;
if ( v99 )
v99 = PlayerObject::isFlying(a1);
PlayerObject::hitGround(a1, v10, v99);
PlayerObject::updateCollideBottom(a1, v45, v10);
PlayerObject::updateLastGroundObject(a1, a3);
a1->m_groundYVelocity = v25;
PlayerObject::setYVelocity(a1, v94, 31);
if ( a1->m_yVelocity > a1->m_groundYVelocity )
v100 = a1->m_groundYVelocity;
else
v100 = a1->m_yVelocity;
PlayerObject::setYVelocity(a1, v100, 32);
}
}
else if ( v62 && m_isPlatformer )
{
v101 = a1->setPosition;
v102 = a1->getPosition(a1);
v103 = v46 - (float)(v186.size.height * 0.5);
cocos2d::CCPoint::CCPoint(&v189.origin, v102->x, v103);
v101(a1, &v189.origin);
v104 = a1->m_isUpsideDown;
if ( v104 )
v104 = PlayerObject::isFlying(a1);
PlayerObject::hitGroundNoJump(a1, v10, v104);
if ( !v60 && !m_isPassable )
PlayerObject::updateCollideTop(a1, v45, v10);
PlayerObject::setYVelocity(a1, v94, 33);
if ( a1->m_yVelocity > a1->m_groundYVelocity - 1.0 )
v105 = a1->m_groundYVelocity - 1.0;
else
v105 = a1->m_yVelocity;
PlayerObject::setYVelocity(a1, v105, 34);
PlayerObject::didHitHead(a1);
if ( v167 )
{
v106 = a1->m_gameLayer;
a1->m_maybeTouchedBreakableBlock = 1;
if ( v106 )
GJBaseGameLayer::destroyObject(v106, v10);
else
GameObject::destroyObject(v10);
}
}
goto LABEL_258;
}
if ( v62 && v94 * (double)PlayerObject::flipMod(a1) > 0.0 && a1->m_gameLayer )
PlayerObject::gameEventTriggered(a1, 6, 0);
v107 = a1->setPosition;
v108 = a1->getPosition(a1);
v109 = v46 - (float)(v186.size.height * 0.5);
cocos2d::CCPoint::CCPoint(&v189.origin, v108->x, v109);
v107(a1, &v189.origin);
if ( v172 )
PlayerObject::checkSnapJumpToObject(a1, v10);
if ( v165 && !v162 )
{
PlayerObject::setYVelocity(a1, 0.0, 29);
}
else
{
v110 = !a1->m_isUpsideDown && PlayerObject::isFlying(a1);
if ( v62 )
PlayerObject::hitGroundNoJump(a1, v10, v110);
else
PlayerObject::hitGround(a1, v10, v110);
}
if ( a1->m_isUpsideDown )
{
if ( v62 )
{
if ( !v60 && !m_isPassable )
{
v112 = v42;
v111 = a1;
goto LABEL_286;
}
LABEL_289:
if ( a1->m_isPlatformer )
PlayerObject::exitPlatformerAnimateJump(a1);
LABEL_291:
if ( v172 && a1->m_stateNoAutoJump > 0 && a1->m_padRingRelated )
a1->m_jumpBuffered = 0;
if ( PlayerObject::isFlying(a1) && v157 )
{
if ( !v62 )
goto LABEL_319;
p_m_groundYVelocity = &a1->m_groundYVelocity;
v122 = 30;
LABEL_322:
PlayerObject::setYVelocity(a1, *p_m_groundYVelocity, v122);
goto LABEL_318;
}
goto LABEL_317;
}
v114 = v45;
v113 = a1;
}
else
{
if ( v62 )
{
if ( !v60 && !m_isPassable )
{
v111 = a1;
v112 = v45;
LABEL_286:
PlayerObject::updateCollideTop(v111, v112, v10);
goto LABEL_289;
}
goto LABEL_289;
}
v113 = a1;
v114 = v42;
}
PlayerObject::updateCollideBottom(v113, v114, v10);
PlayerObject::updateLastGroundObject(a1, a3);
a1->m_groundYVelocity = v25;
goto LABEL_291;
}
if ( m_uniqueID != a1->m_unk510 )
goto LABEL_210;
}
if ( !a1->m_isBird || !v60 || a1->m_isPlatformer )
goto LABEL_221;
((void (__fastcall *)(cocos2d::CCRect *, PlayerObject *, int, int))a1->getObjectRect_0)(
&v189,
a1,
1050253722,
1050253722);
if ( cocos2d::CCRect::intersectsRect(&v187, &v189) )
goto LABEL_231;
LABEL_258:
m_gameLayer = nullptr;
LABEL_156:
if ( a1->m_isPlatformer )
{
v66 = a1->getPosition(a1);
cocos2d::CCPoint::CCPoint(&v184, v66);
a1->getPosition(a1);
a1->getPosition(a1);
v67 = a1->getPosition(a1);
v68 = v186.size.height;
v69 = v67->y;
v70 = a1->getPosition(a1);
v71 = v186.size.height;
v72 = v70->y;
if ( a3 )
{
if ( a2 <= 0.0 )
{
v82 = 0.0;
v80 = 0;
v79 = 0;
}
else
{
v73 = GameObject::getLastPosition(a3);
cocos2d::CCPoint::CCPoint(&v185, v73);
a3->getRealPosition((cocos2d::CCPoint *)&v188, a3);
v74 = a1->getPosition;
if ( a1->m_isSideways )
v75 = v74(a1)->x;
else
v75 = v74(a1)->y;
if ( a1->m_isSideways )
{
v76 = v185.y;
v77 = v188.origin.y;
GameObject::getScalePosDelta(&v189.origin, a3);
v78 = v189.origin.y;
}
else
{
v76 = v185.x;
v77 = v188.origin.x;
GameObject::getScalePosDelta(&v189.origin, a3);
v78 = v189.origin.x;
}
v79 = (float)((float)(v77 - v76) + v78) < 0.0;
v80 = (float)((float)(v77 - v76) - v78) > 0.0;
if ( v75 >= v77 )
v81 = v76 - v78;
else
v81 = v76 + v78;
v82 = (float)(v77 - v81) / a2;
}
}
else
{
v82 = 0.0;
v80 = 0;
v79 = 0;
}
if ( a1->m_isOnSlope || a1->m_wasOnSlope || a1->m_totalTime - a1->m_slopeEndTime < 0.200000003 )
{
v85 = a1->getPosition(a1);
v86 = v186.size.height * 0.5;
v87 = v85->y;
v83 = (float)(v87 + (float)(v86 * (float)PlayerObject::flipMod(a1)));
v84 = a1->getPosition(a1)->y;
}
else
{
v83 = (float)(v69 + (float)(v68 * 0.5)) - v13;
v84 = (float)(v72 - (float)(v71 * 0.5)) + v13;
}
if ( a3 )
{
v88 = a3 == a1->m_collidingWithLeft;
if ( a3 == a1->m_collidingWithRight )
{
v89 = 1;
goto LABEL_181;
}
}
else
{
v88 = 0;
}
v89 = 0;
LABEL_181:
cocos2d::CCRect::CCRect(
&v189,
v186.origin.x,
v186.origin.y + (float)(v175 * 0.5),
v186.size.width,
v186.size.height - v175);
if ( !m_isPassable
&& (cocos2d::CCRect::intersectsRect(&v189, &v187) || v88 || v89)
&& (v83 < v44 && v83 > v46 || v84 < v44 && v84 > v46) )
{
a1->m_scaleXRelated4 = v82;
if ( v88 || a1->getPosition(a1)->x > (float)(v182 + (float)(width * 0.5)) && !v89 )
{
PlayerObject::updateCollideLeft(a1, v178, v10);
v129 = a1->setPosition;
v130 = v178 + (float)(v186.size.width * 0.5);
v132 = a1->getPosition(a1);
v131 = v130;
cocos2d::CCPoint::CCPoint(&v188.origin, v131, v132->y);
v129(a1, &v188.origin);
if ( a1->m_platformerXVelocity < 0.0 && (!m_holdingLeft || !v79) )
a1->m_platformerXVelocity = 0.0;
if ( a1->m_isDashing )
{
m_dashRing = a1->m_dashRing;
if ( !m_dashRing || !m_dashRing->m_allowCollide )
{
PlayerObject::stopDashing(a1);
a1->m_jumpBuffered = 0;
}
}
m_platformerMovingLeft = a1->m_platformerMovingLeft;
}
else
{
PlayerObject::updateCollideRight(a1, v177, v10);
v123 = a1->setPosition;
v124 = v177 - (float)(v186.size.width * 0.5);
v126 = a1->getPosition(a1);
v125 = v124;
cocos2d::CCPoint::CCPoint(&v188.origin, v125, v126->y);
v123(a1, &v188.origin);
if ( a1->m_platformerXVelocity > 0.0 && (!m_holdingRight || !v80) )
a1->m_platformerXVelocity = 0.0;
if ( a1->m_isDashing )
{
v127 = a1->m_dashRing;
if ( !v127 || !v127->m_allowCollide )
{
PlayerObject::stopDashing(a1);
a1->m_jumpBuffered = 0;
}
}
m_platformerMovingLeft = a1->m_platformerMovingRight;
}
if ( m_platformerMovingLeft )
a1->m_maybeSlidingTime = 0;
}
if ( !m_gameLayer || a1->m_isPlatformer )
goto LABEL_196;
goto LABEL_190;
}
if ( !m_gameLayer )
goto LABEL_196;
LABEL_190:
if ( m_isPassable )
goto LABEL_196;
((void (__fastcall *)(cocos2d::CCRect *, PlayerObject *, int, int))a1->getObjectRect_0)(
&v189,
a1,
1050253722,
1050253722);
v90 = cocos2d::CCRect::intersectsRect(&v187, &v189);
if ( !v90 )
goto LABEL_196;
if ( v62 && PlayerObject::isSafeFlip(a1, 0.1) )
{
v134 = a1->GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v135 = a1->setPosition;
if ( a1->m_isUpsideDown )
{
v138 = v134->getPosition(a1);
v137 = v44 + (float)(v186.size.height * 0.5);
v136 = v138->x;
}
else
{
v136 = v134->getPosition(a1)->x;
v137 = v46 - (float)(v186.size.height * 0.5);
}
cocos2d::CCPoint::CCPoint(&v188.origin, v136, v137);
v135(a1, &v188.origin);
PlayerObject::hitGround(a1, v10, 1);
a1->m_isOnGround2 = 0;
}
else if ( !a1->m_isSpider
|| (v139 = COERCE_FLOAT(cocos2d::CCRect::getMaxX(&v187)), v139 >= COERCE_FLOAT(cocos2d::CCRect::getMaxX(&v189)))
|| !PlayerObject::isSafeSpiderFlip(a1, 0.04) )
{
if ( v10 && v10->getType(v10) == Breakable )
{
v140 = a1->m_gameLayer;
if ( v140 )
GJBaseGameLayer::destroyObject(v140, v10);
else
GameObject::destroyObject(v10);
return v90;
}
m_maybeCanRunIntoBlocks = a1->m_maybeCanRunIntoBlocks;
if ( !a1->m_maybeCanRunIntoBlocks )
{
v142 = GameManager::sharedState();
v142->m_playLayer->destroyPlayer(v142->m_playLayer, a1, (GameObject *)m_maybeCanRunIntoBlocks);
return v90;
}
if ( !a1->m_ignoreDamage )
{
a1->m_maybeIsColliding = 1;
return v90;
}
LABEL_196:
LOBYTE(v90) = 0;
}
return v90;
}