//
// PlayerObject::collidedWithObjectInternal from 0x62ea78 to 0x6304e8 (6768 bytes)
//
// 5 xrefs:
// > PlayerObject::preSlopeCollision @ 0x6335c0
// > PlayerObject::preSlopeCollision @ 0x6335f8
// > PlayerObject::handleRotatedCollisionInternal @ 0x638660
// > PlayerObject::collidedWithObject @ 0x638820
// > ??> @ 0xc2328
//
// 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
//
// local variable allocation has failed, the output may be wrong!
bool PlayerObject::collidedWithObjectInternal(PlayerObject *a1, float a2, GameObject *a3, cocos2d::CCRect a4, bool a5)
{
unsigned __int8 v5; // w3
_BOOL8 v7; // x20
char v8; // w0
PlayerObject_vtbl *v9; // x1
const cocos2d::CCRect *v10; // x0
GameObject *v11; // x22
const cocos2d::CCRect *v12; // x1
double v13; // d12
const cocos2d::CCPoint *LastPosition; // x0
PlayerObject_vtbl *v15; // x1
float x; // s15
float y; // s8
float v18; // s9
float v19; // s0
_BOOL4 m_isPlatformer; // w1
PlayerObject_vtbl *v21; // x1
float v22; // s0
double v23; // d15
float v24; // s9
float v25; // s8
float v26; // s0
float v27; // s0
float v28; // s0
double v29; // d14
float v30; // s0
double v31; // d13
_BOOL4 v32; // w26
std::__detail::_Hash_node_base *M_nxt; // x21
int v34; // w25
int v35; // w28
GameObject *v36; // x20
cocos2d::CCRect *v37; // x0
float v38; // s0
unsigned int v39; // w26
unsigned int v40; // w21
bool v41; // w0
long double v42; // q0
_BOOL4 m_isUpsideDown; // w24
unsigned int v44; // w27
unsigned int v45; // w0
const cocos2d::CCRect *v46; // x0
cocos2d::CCRect *v47; // x0
float v48; // s0
double v49; // d0
bool v50; // w0
double v51; // d0
double unk_584; // d8
unsigned int v53; // w0
double v54; // d12
double v55; // d9
int v56; // w20
unsigned int v57; // w21
int m_uniqueID; // w0
double v59; // d8
GJBaseGameLayer *m_gameLayer; // x0
char v61; // w21
double m_yVelocity; // d8
void (__fastcall *v64)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x20
float *v65; // x0
float v66; // s1
bool v67; // w0
double m_groundYVelocity; // d0
void (__fastcall *v69)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x23
const cocos2d::CCPoint *v70; // x0
float v71; // s1
bool v72; // w2
void (__fastcall *setPosition)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x23
float *v74; // x0
float v75; // s1
bool isFlying; // w2
const cocos2d::CCPoint *v77; // x0
float v78; // s12
float v79; // s8
float v80; // s11
float v81; // s9
const cocos2d::CCPoint *v82; // x0
PlayerObject_vtbl *v83; // x1
float v84; // w21
float v85; // s15
float v86; // s10
float v87; // s1
_BOOL4 v88; // w26
_BOOL4 v89; // w25
float v90; // s15
float v91; // s10
float v92; // s8
float v93; // s9
double v94; // d8
double v95; // d9
_BOOL4 v96; // w21
int v97; // w28
void (__fastcall *v98)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x25
float v99; // s0
const cocos2d::CCPoint *v100; // x0
DashRingObject *m_dashRing; // x0
double v102; // d8
double v103; // d0
float v104; // s0
float v105; // s8
float v106; // s0
float v107; // s8
void (__fastcall *v108)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x20
float *v109; // x0
float v110; // s1
bool v111; // w2
double v112; // d0
GJBaseGameLayer *v113; // x0
void (__fastcall *v114)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x20
const cocos2d::CCPoint *v115; // x0
float v116; // s1
bool v117; // w2
double v118; // d0
GJBaseGameLayer *v119; // x0
void (__fastcall *v120)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x23
float v121; // s0
double v122; // d1
float v123; // s1
void (__fastcall *v124)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x24
float v125; // s0
const cocos2d::CCPoint *v126; // x0
DashRingObject *v127; // x0
GJBaseGameLayer *v128; // x0
void (__fastcall *v129)(PlayerObject *__hidden, const cocos2d::CCPoint *); // x20
const cocos2d::CCPoint *v130; // x0
float v131; // s1
bool v132; // w0
double v133; // d0
GameManager *v134; // x0
__int64 v135; // [xsp+A4h] [xbp+A4h]
float v136; // [xsp+ACh] [xbp+ACh]
_BOOL4 v137; // [xsp+B0h] [xbp+B0h]
float width; // [xsp+B4h] [xbp+B4h]
float v139; // [xsp+B8h] [xbp+B8h]
float v140; // [xsp+BCh] [xbp+BCh]
_BOOL4 v141; // [xsp+C0h] [xbp+C0h]
int v142; // [xsp+C0h] [xbp+C0h]
float v143; // [xsp+C4h] [xbp+C4h]
float v144; // [xsp+C8h] [xbp+C8h]
float v145; // [xsp+CCh] [xbp+CCh]
int v146; // [xsp+D8h] [xbp+D8h]
int v147; // [xsp+DCh] [xbp+DCh]
float height; // [xsp+E0h] [xbp+E0h]
float v149; // [xsp+E4h] [xbp+E4h]
double v150; // [xsp+E8h] [xbp+E8h]
unsigned int v151; // [xsp+F0h] [xbp+F0h]
unsigned int m_holdingLeft; // [xsp+F4h] [xbp+F4h]
unsigned int m_holdingRight; // [xsp+F8h] [xbp+F8h]
float v154; // [xsp+FCh] [xbp+FCh]
double v155; // [xsp+100h] [xbp+100h]
double v156; // [xsp+108h] [xbp+108h]
_BOOL4 v157; // [xsp+110h] [xbp+110h]
_BOOL4 m_isPassable; // [xsp+11Ch] [xbp+11Ch]
float v161; // [xsp+120h] [xbp+120h]
float v162; // [xsp+120h] [xbp+120h]
unsigned int v163; // [xsp+130h] [xbp+130h]
double v164; // [xsp+130h] [xbp+130h]
cocos2d::CCPoint v165; // [xsp+148h] [xbp+148h] BYREF
cocos2d::CCPoint v166; // [xsp+150h] [xbp+150h] BYREF
cocos2d::CCRect v167; // [xsp+158h] [xbp+158h] BYREF
cocos2d::CCRect v168; // [xsp+168h] [xbp+168h] BYREF
cocos2d::CCRect v169; // [xsp+178h] [xbp+178h] BYREF
cocos2d::CCRect v170; // [xsp+188h] [xbp+188h] BYREF
cocos2d::CCRect v171; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v146 = v5;
v7 = a5;
m_holdingRight = a1->m_holdingRight;
m_holdingLeft = a1->m_holdingLeft;
if ( a1->m_holdingRight && a1->m_holdingLeft )
{
m_holdingRight = !a1->m_leftPressedFirst;
m_holdingLeft = a1->m_leftPressedFirst;
}
v8 = cocos2d::CCRect::equals((cocos2d::CCRect *)a5, &stru_1242038);
v9 = a1->GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( v8 )
{
v10 = v9->getObjectRect(a1);
cocos2d::CCRect::CCRect(&v167, v10);
v11 = a3;
if ( a3 )
{
v12 = a3->getObjectRect(a3);
}
else
{
v11 = nullptr;
v12 = (const cocos2d::CCRect *)v7;
}
}
else
{
v11 = nullptr;
v46 = v9->getObjectRect(a1);
cocos2d::CCRect::CCRect(&v167, v46);
v12 = (const cocos2d::CCRect *)v7;
}
cocos2d::CCRect::CCRect(&v168, v12);
if ( !a1->m_isPlatformer || a1->m_wasOnSlope || a1->m_isOnSlope )
v156 = 10.0;
else
v156 = 5.0;
if ( a1->m_stateScale > 0 )
v156 = 15.0;
v13 = (double)PlayerObject::flipMod(a1) * v156;
if ( PlayerObject::isFlying(a1) && !a1->m_isPlatformer )
v13 = (float)((float)PlayerObject::flipMod(a1) * 6.0);
if ( a1->m_wasOnSlope )
{
unk_584 = a1->unk_584;
v13 = v13 + unk_584 * (double)PlayerObject::flipMod(a1);
if ( v11 )
goto LABEL_17;
}
else if ( v11 )
{
LABEL_17:
m_isPassable = v11->m_isPassable;
goto LABEL_18;
}
m_isPassable = 0;
LABEL_18:
if ( a3 == nullptr || a2 <= 0.0 )
goto LABEL_67;
LastPosition = GameObject::getLastPosition(a3);
cocos2d::CCPoint::CCPoint(&v166, LastPosition);
((void (__fastcall *)(cocos2d::CCRect *__return_ptr, GameObject *))a3->getRealPosition)(&v169, a3);
v15 = a1->GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( a1->m_isSideways )
{
x = v166.x;
y = v169.origin.x;
v18 = v15->getPosition(a1)->x;
if ( a1->m_isSideways )
goto LABEL_21;
}
else
{
x = v166.y;
y = v169.origin.y;
v18 = v15->getPosition(a1)->y;
if ( a1->m_isSideways )
{
LABEL_21:
GameObject::getScalePosDelta(a3);
v19 = v170.origin.x;
goto LABEL_22;
}
}
GameObject::getScalePosDelta(a3);
v19 = v170.origin.y;
LABEL_22:
if ( v19 != 0.0 )
{
if ( v18 >= y )
x = x - v19;
else
x = x + v19;
}
if ( v169.origin.x == v166.x && v169.origin.y == v166.y )
goto LABEL_67;
if ( a1->m_isUpsideDown )
{
if ( x > y )
goto LABEL_258;
if ( x < y )
goto LABEL_30;
LABEL_67:
v135 = 0;
v137 = 0;
v136 = 0.0;
if ( a1->m_isPlatformer )
goto LABEL_68;
goto LABEL_32;
}
if ( x >= y )
{
if ( x > y )
{
LABEL_30:
m_isPlatformer = a1->m_isPlatformer;
v135 = 1;
v137 = 0;
v136 = 0.0;
goto LABEL_31;
}
goto LABEL_67;
}
LABEL_258:
v136 = (float)(y - x) / a2;
v102 = fabsf(v136);
v137 = v102 > 5.0;
v103 = (double)PlayerObject::flipMod(a1);
m_isPlatformer = a1->m_isPlatformer;
v13 = v13 + v103 * v102;
if ( a1->m_isPlatformer )
{
v135 = 0x100000000LL;
LABEL_31:
if ( !m_isPlatformer )
goto LABEL_32;
LABEL_68:
v154 = 5.0;
goto LABEL_34;
}
v135 = 0x100000000LL;
a1->m_groundYVelocity = v136;
LABEL_32:
if ( a1->m_stateHitHead > 0 )
{
v154 = 0.0;
goto LABEL_34;
}
v154 = 0.0;
if ( a1->m_stateFlipGravity > 0 )
{
LABEL_34:
v151 = !m_isPassable;
goto LABEL_35;
}
v151 = 0;
LABEL_35:
v21 = a1->GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( a1->m_isSideways )
v22 = v21->getPosition(a1)->x - a1->m_lastPosition.x;
else
v22 = v21->getPosition(a1)->y - a1->m_lastPosition.y;
v23 = v22;
a1->getPosition(a1);
v24 = a1->getPosition(a1)->y;
v25 = v167.size.height * 0.5;
v155 = (float)(v24 - (float)(v25 * (float)PlayerObject::flipMod(a1))) + v13;
v149 = a1->getPosition(a1)->y;
height = v167.size.height;
v147 = PlayerObject::flipMod(a1);
v150 = v155 - v23;
a1->getPosition(a1);
if ( a1->m_isUpsideDown )
v141 = v23 < 0.0;
else
v141 = v23 > 0.0;
cocos2d::CCRect::getMinX(&v168);
v140 = v26;
cocos2d::CCRect::getMaxX(&v168);
v143 = v27;
cocos2d::CCRect::getMaxY(&v168);
v29 = v28;
v145 = v28;
cocos2d::CCRect::getMinY(&v168);
v144 = v30;
v31 = v30;
v139 = v168.origin.x;
width = v168.size.width;
if ( a1->m_isDart && a1->m_stateDartSlide <= 0 )
{
v56 = 1;
v44 = 0;
goto LABEL_155;
}
if ( a1->m_isOnSlope )
{
v32 = 1;
}
else
{
if ( !a1->m_wasOnSlope && !a1->m_potentialSlopeMap._M_h._M_element_count )
goto LABEL_160;
v32 = a1->m_wasOnSlope || v11 == nullptr;
}
M_nxt = a1->m_potentialSlopeMap._M_h._M_before_begin._M_nxt;
if ( M_nxt )
{
v163 = 0;
v34 = 0;
v35 = 0;
while ( 1 )
{
v36 = (GameObject *)M_nxt[2]._M_nxt;
if ( !v32
&& a1->m_currentSlope != v36
&& ((v37 = (cocos2d::CCRect *)v36->getObjectRect(M_nxt[2]._M_nxt),
cocos2d::CCRect::getMinX(v37),
v38 >= v11->getPosition(v11)->x)
|| (v47 = (cocos2d::CCRect *)v36->getObjectRect(v36),
cocos2d::CCRect::getMaxX(v47),
v48 <= v11->getPosition(v11)->x))
|| (((void (__fastcall *)(cocos2d::CCRect *__return_ptr, GameObject *, float, float))v36->getObjectRect_0)(
&v169,
v36,
1.2,
1.1),
!(unsigned __int8)cocos2d::CCRect::intersectsRect(&v168, &v169))
|| (((void (__fastcall *)(cocos2d::CCRect *__return_ptr, GameObject *, float, float))v36->getObjectRect_0)(
&v170,
v36,
1.2,
1.1),
!(unsigned __int8)cocos2d::CCRect::intersectsRect(&v167, &v170)) )
{
if ( !v34 )
goto LABEL_50;
goto LABEL_49;
}
cocos2d::CCRect::CCRect(&v170, &v168);
GameObject::slopeYPos(v36, v171);
v164 = v49;
v50 = GameObject::slopeFloorTop(v36);
v51 = v164 - 2.0;
if ( v29 > v164 + 2.0 )
break;
if ( !v50 )
{
if ( v31 < v51 )
{
v163 = 1;
v35 = 1;
if ( !v34 )
goto LABEL_50;
LABEL_49:
if ( v35 )
goto LABEL_84;
goto LABEL_50;
}
v35 = 1;
LABEL_110:
v163 = 1;
if ( a1->m_currentSlope != v36 )
{
if ( !v34 )
goto LABEL_50;
goto LABEL_49;
}
goto LABEL_83;
}
if ( a1->m_currentSlope == v36 )
v35 = 1;
if ( v31 < v51 )
{
LABEL_113:
v163 = 1;
if ( !v34 )
goto LABEL_50;
goto LABEL_49;
}
LABEL_83:
v163 = 1;
v34 = 1;
if ( v35 )
{
LABEL_84:
v34 = 1;
LOBYTE(v35) = 1;
if ( !v11 )
goto LABEL_85;
LABEL_52:
v39 = ((__int64 (__fastcall *)(GameObject *))v11->getType)(v11) == 21;
goto LABEL_53;
}
LABEL_50:
M_nxt = M_nxt->_M_nxt;
if ( !M_nxt )
goto LABEL_51;
}
if ( v31 < v51 )
goto LABEL_113;
if ( v50 )
goto LABEL_83;
goto LABEL_110;
}
LABEL_160:
v34 = 0;
LOBYTE(v35) = 0;
v163 = 0;
LABEL_51:
if ( v11 )
goto LABEL_52;
LABEL_85:
v39 = 0;
LABEL_53:
v40 = 1;
cocos2d::CCRect::CCRect(
&v169,
v167.origin.x + (float)(v154 * 0.5),
v167.origin.y,
v167.size.width - v154,
v167.size.height);
v41 = PlayerObject::isInNormalMode(a1);
m_isUpsideDown = a1->m_isUpsideDown;
v157 = v41;
if ( !a1->m_isUpsideDown )
goto LABEL_55;
if ( PlayerObject::isFlying(a1) || (v40 = 0, a1->m_isBall) )
v40 = !m_isPassable;
m_isUpsideDown = a1->m_isUpsideDown;
if ( !a1->m_isUpsideDown )
{
LABEL_55:
if ( v155 > v31 && v150 > v31 )
goto LABEL_98;
LABEL_56:
if ( !a1->m_isPlatformer )
{
v44 = 1;
v142 = 0;
goto LABEL_120;
}
if ( v141 && v39 && !a1->m_maybeTouchedBreakableBlock )
{
if ( a1->m_isOnSlope )
{
v142 = 1;
}
else
{
v44 = 1;
v142 = 1;
if ( !a1->m_wasOnSlope )
goto LABEL_105;
}
goto LABEL_62;
}
v44 = 1;
if ( a1->m_isOnSlope )
{
v142 = 0;
goto LABEL_62;
}
LABEL_100:
v142 = 0;
if ( !a1->m_wasOnSlope )
goto LABEL_105;
if ( !v44 )
goto LABEL_102;
LABEL_62:
v44 = 1;
v45 = v163;
if ( !a1->m_maybeUpsideDownSlope )
v45 = 0;
v163 = v45;
goto LABEL_105;
}
if ( v155 >= v29 || v150 >= v29 )
goto LABEL_56;
LABEL_98:
if ( !a1->m_isPlatformer )
{
v44 = 0;
v142 = 0;
goto LABEL_120;
}
v44 = 0;
if ( !a1->m_isOnSlope )
goto LABEL_100;
v142 = 0;
LABEL_102:
v44 = 0;
v53 = v163;
if ( a1->m_maybeUpsideDownSlope )
v53 = 0;
v163 = v53;
LABEL_105:
if ( !v146 )
{
if ( !(unsigned __int8)cocos2d::CCRect::intersectsRect(&v169, &v168) )
{
v56 = 1;
goto LABEL_155;
}
m_isUpsideDown = a1->m_isUpsideDown;
}
LABEL_120:
*(double *)&v42 = (float)(v149 - (float)((float)(height * 0.5) * (float)-v147));
v54 = *(double *)&v42 - v13;
v55 = v54 - v23;
if ( !v40 && !v151 )
{
v56 = 1;
if ( m_isUpsideDown )
{
LABEL_123:
v57 = 1;
goto LABEL_124;
}
goto LABEL_176;
}
if ( m_isUpsideDown )
{
if ( v54 < v29 )
{
v56 = 1;
if ( v55 < v29 )
goto LABEL_123;
}
if ( v39 && a1->m_isBird && !a1->m_isPlatformer )
{
((void (__fastcall *)(cocos2d::CCRect *__return_ptr, PlayerObject *, float, float))a1->getObjectRect_0)(
&v170,
a1,
0.3,
0.3);
if ( (unsigned __int8)cocos2d::CCRect::intersectsRect(&v168, &v170) )
goto LABEL_151;
LABEL_377:
v56 = 0;
if ( a1->m_isUpsideDown )
goto LABEL_123;
goto LABEL_176;
}
}
else
{
*(double *)&v42 = v155;
if ( v155 < v29 )
{
*(double *)&v42 = v155 - v23;
v56 = 1;
if ( v150 < v29 )
goto LABEL_176;
}
}
m_yVelocity = a1->m_yVelocity;
if ( (m_yVelocity <= 0.0 || v137 || a1->m_wasOnSlope) && v163 <= ((unsigned __int8)v35 ^ 1u) )
{
if ( v44 )
{
*(double *)&v42 = (double)PlayerObject::flipMod(a1);
if ( m_yVelocity * *(double *)&v42 > 0.0 )
{
if ( a1->m_gameLayer )
PlayerObject::gameEventTriggered(a1, 6, 0);
}
}
setPosition = a1->setPosition;
v74 = (float *)((__int64 (__fastcall *)(PlayerObject *, long double))a1->getPosition)(a1, v42);
v75 = (float)(v167.size.height * 0.5) + v29;
cocos2d::CCPoint::CCPoint(&v170.origin, *v74, v75);
setPosition(a1, &v170.origin);
if ( v157 )
PlayerObject::checkSnapJumpToObject(a1, v11);
if ( v151 > v40 )
{
PlayerObject::setYVelocity(a1, 0.0, 23);
}
else
{
isFlying = 0;
if ( a1->m_isUpsideDown )
isFlying = PlayerObject::isFlying(a1);
if ( !v44 )
{
PlayerObject::hitGround(a1, v11, isFlying);
if ( a1->m_isUpsideDown )
{
LABEL_215:
PlayerObject::updateCollideBottom(a1, v144, v11);
LABEL_216:
PlayerObject::updateLastGroundObject(a1, a3);
a1->m_groundYVelocity = v136;
goto LABEL_217;
}
LABEL_330:
PlayerObject::updateCollideBottom(a1, v145, v11);
goto LABEL_216;
}
PlayerObject::hitGroundNoJump(a1, v11, isFlying);
}
if ( a1->m_isUpsideDown )
{
if ( v39 >= v44 )
{
if ( !v44 )
goto LABEL_215;
}
else if ( !m_isPassable )
{
PlayerObject::updateCollideTop(a1, v145, v11);
}
}
else if ( v39 >= v44 )
{
if ( !v44 )
goto LABEL_330;
}
else if ( !m_isPassable )
{
PlayerObject::updateCollideTop(a1, v144, v11);
}
if ( a1->m_isPlatformer )
PlayerObject::exitPlatformerAnimateJump(a1);
LABEL_217:
if ( v157 && a1->m_stateNoAutoJump > 0 && a1->m_padRingRelated )
a1->m_jumpBuffered = 0;
if ( PlayerObject::isFlying(a1) && HIDWORD(v135) )
{
if ( v44 )
{
PlayerObject::setYVelocity(a1, a1->m_groundYVelocity, 24);
goto LABEL_225;
}
LABEL_226:
if ( !v142 )
return 1;
m_gameLayer = a1->m_gameLayer;
a1->m_maybeTouchedBreakableBlock = 1;
if ( !m_gameLayer )
goto LABEL_228;
LABEL_152:
GJBaseGameLayer::destroyObject(m_gameLayer, v11);
return 1;
}
LABEL_320:
if ( !v44 )
goto LABEL_226;
goto LABEL_225;
}
if ( m_isUpsideDown )
{
if ( !v44 || !(_DWORD)v135 )
{
v56 = 0;
v57 = 1;
goto LABEL_124;
}
v107 = m_yVelocity;
v108 = a1->setPosition;
v109 = (float *)((__int64 (__fastcall *)(PlayerObject *, long double))a1->getPosition)(a1, v42);
v110 = (float)(v167.size.height * 0.5) + v29;
cocos2d::CCPoint::CCPoint(&v170.origin, *v109, v110);
v108(a1, &v170.origin);
v111 = a1->m_isUpsideDown;
if ( v111 )
v111 = PlayerObject::isFlying(a1);
PlayerObject::hitGroundNoJump(a1, v11, v111);
if ( v39 < !m_isPassable )
PlayerObject::updateCollideTop(a1, v145, v11);
PlayerObject::setYVelocity(a1, v107, 27);
v112 = a1->m_groundYVelocity + 1.0;
if ( a1->m_yVelocity >= v112 )
v112 = a1->m_yVelocity;
PlayerObject::setYVelocity(a1, v112, 28);
PlayerObject::didHitHead(a1);
if ( v142 )
{
v113 = a1->m_gameLayer;
a1->m_maybeTouchedBreakableBlock = 1;
if ( v113 )
{
v56 = 0;
GJBaseGameLayer::destroyObject(v113, v11);
if ( a1->m_isUpsideDown )
goto LABEL_123;
}
else
{
v56 = 0;
GameObject::destroyObject(v11);
if ( a1->m_isUpsideDown )
goto LABEL_123;
}
goto LABEL_176;
}
goto LABEL_377;
}
v56 = 0;
if ( HIDWORD(v135) > v44 )
{
v64 = a1->setPosition;
v65 = (float *)((__int64 (__fastcall *)(PlayerObject *, long double))a1->getPosition)(a1, v42);
v66 = (float)(v167.size.height * 0.5) + v29;
cocos2d::CCPoint::CCPoint(&v170.origin, *v65, v66);
v64(a1, &v170.origin);
v67 = a1->m_isUpsideDown;
if ( v67 )
v67 = PlayerObject::isFlying(a1);
PlayerObject::hitGround(a1, v11, v67);
PlayerObject::updateCollideBottom(a1, v145, v11);
PlayerObject::updateLastGroundObject(a1, a3);
a1->m_groundYVelocity = v136;
PlayerObject::setYVelocity(a1, m_yVelocity, 25);
m_groundYVelocity = a1->m_groundYVelocity;
if ( a1->m_yVelocity >= m_groundYVelocity )
m_groundYVelocity = a1->m_yVelocity;
v56 = 0;
PlayerObject::setYVelocity(a1, m_groundYVelocity, 26);
if ( a1->m_isUpsideDown )
goto LABEL_123;
}
LABEL_176:
if ( (PlayerObject::isFlying(a1) || a1->m_isBall) && !m_isPassable )
goto LABEL_123;
if ( !v151 )
goto LABEL_155;
v57 = 0;
LABEL_124:
if ( !v56 )
goto LABEL_155;
if ( a1->m_isUpsideDown )
{
v55 = v155 - v23;
v54 = v155;
}
if ( v11 )
m_uniqueID = v11->m_uniqueID;
else
m_uniqueID = 0;
if ( v54 <= v31 || v55 <= v31 )
{
if ( a1->m_isUpsideDown )
goto LABEL_182;
}
else
{
if ( a1->m_isUpsideDown )
{
if ( m_uniqueID != a1->m_unk50C )
goto LABEL_155;
LABEL_182:
v59 = a1->m_yVelocity;
if ( v59 >= 0.0 )
goto LABEL_183;
if ( !a1->m_isPlatformer )
goto LABEL_138;
goto LABEL_137;
}
if ( m_uniqueID != a1->m_unk510 )
goto LABEL_155;
}
if ( !v39 || !a1->m_isBird )
goto LABEL_182;
if ( !a1->m_isPlatformer )
{
((void (__fastcall *)(cocos2d::CCRect *__return_ptr, PlayerObject *, float, float))a1->getObjectRect_0)(
&v170,
a1,
0.3,
0.3);
if ( !(unsigned __int8)cocos2d::CCRect::intersectsRect(&v168, &v170) )
{
v56 = 0;
goto LABEL_155;
}
LABEL_151:
m_gameLayer = a1->m_gameLayer;
if ( !m_gameLayer )
{
LABEL_228:
v61 = 1;
GameObject::destroyObject(v11);
return v61;
}
goto LABEL_152;
}
v59 = a1->m_yVelocity;
if ( v59 >= 0.0 )
goto LABEL_183;
LABEL_137:
if ( a1->m_yVelocityRelated > 0.0 )
goto LABEL_183;
LABEL_138:
if ( v137 || a1->m_wasOnSlope )
{
LABEL_183:
if ( v163 > (v34 ^ 1u) )
goto LABEL_140;
if ( v44 && v59 * (double)PlayerObject::flipMod(a1) > 0.0 && a1->m_gameLayer )
PlayerObject::gameEventTriggered(a1, 6, 0);
v69 = a1->setPosition;
v70 = a1->getPosition(a1);
v71 = v31 - (float)(v167.size.height * 0.5);
cocos2d::CCPoint::CCPoint(&v170.origin, v70->x, v71);
v69(a1, &v170.origin);
if ( v157 )
PlayerObject::checkSnapJumpToObject(a1, v11);
if ( v151 > v57 )
{
PlayerObject::setYVelocity(a1, 0.0, 29);
}
else
{
v72 = 0;
if ( !a1->m_isUpsideDown )
v72 = PlayerObject::isFlying(a1);
if ( !v44 )
{
PlayerObject::hitGround(a1, v11, v72);
if ( !a1->m_isUpsideDown )
{
LABEL_357:
PlayerObject::updateCollideBottom(a1, v145, v11);
goto LABEL_355;
}
goto LABEL_354;
}
PlayerObject::hitGroundNoJump(a1, v11, v72);
}
if ( !a1->m_isUpsideDown )
{
if ( v39 < v44 )
{
if ( !m_isPassable )
PlayerObject::updateCollideTop(a1, v144, v11);
goto LABEL_196;
}
if ( !v44 )
goto LABEL_357;
LABEL_196:
if ( a1->m_isPlatformer )
PlayerObject::exitPlatformerAnimateJump(a1);
LABEL_198:
if ( v157 && a1->m_stateNoAutoJump > 0 && a1->m_padRingRelated )
a1->m_jumpBuffered = 0;
if ( PlayerObject::isFlying(a1) && HIDWORD(v135) )
{
if ( v44 )
{
PlayerObject::setYVelocity(a1, a1->m_groundYVelocity, 30);
LABEL_225:
PlayerObject::didHitHead(a1);
goto LABEL_226;
}
goto LABEL_226;
}
goto LABEL_320;
}
if ( v39 < v44 )
{
if ( !m_isPassable )
PlayerObject::updateCollideTop(a1, v145, v11);
goto LABEL_196;
}
if ( v44 )
goto LABEL_196;
LABEL_354:
PlayerObject::updateCollideBottom(a1, v144, v11);
LABEL_355:
PlayerObject::updateLastGroundObject(a1, a3);
a1->m_groundYVelocity = v136;
goto LABEL_198;
}
LABEL_140:
if ( a1->m_isUpsideDown )
{
v56 = 0;
if ( HIDWORD(v135) > v44 )
{
v129 = a1->setPosition;
v130 = a1->getPosition(a1);
v131 = v31 - (float)(v167.size.height * 0.5);
cocos2d::CCPoint::CCPoint(&v170.origin, v130->x, v131);
v129(a1, &v170.origin);
v132 = a1->m_isUpsideDown;
if ( v132 )
v132 = PlayerObject::isFlying(a1);
PlayerObject::hitGround(a1, v11, v132);
PlayerObject::updateCollideBottom(a1, v144, v11);
PlayerObject::updateLastGroundObject(a1, a3);
a1->m_groundYVelocity = v136;
PlayerObject::setYVelocity(a1, v59, 31);
v133 = a1->m_groundYVelocity;
if ( a1->m_yVelocity <= v133 )
v133 = a1->m_yVelocity;
v56 = 0;
PlayerObject::setYVelocity(a1, v133, 32);
}
}
else if ( v44 && (_DWORD)v135 )
{
v114 = a1->setPosition;
v115 = a1->getPosition(a1);
v116 = v31 - (float)(v167.size.height * 0.5);
cocos2d::CCPoint::CCPoint(&v170.origin, v115->x, v116);
v114(a1, &v170.origin);
v117 = a1->m_isUpsideDown;
if ( v117 )
v117 = PlayerObject::isFlying(a1);
PlayerObject::hitGroundNoJump(a1, v11, v117);
if ( v39 < !m_isPassable )
PlayerObject::updateCollideTop(a1, v144, v11);
PlayerObject::setYVelocity(a1, v59, 33);
v118 = a1->m_groundYVelocity - 1.0;
if ( a1->m_yVelocity <= v118 )
v118 = a1->m_yVelocity;
PlayerObject::setYVelocity(a1, v118, 34);
PlayerObject::didHitHead(a1);
if ( v142 )
{
v119 = a1->m_gameLayer;
a1->m_maybeTouchedBreakableBlock = 1;
v44 = 1;
v56 = 0;
if ( v119 )
GJBaseGameLayer::destroyObject(v119, v11);
else
GameObject::destroyObject(v11);
}
else
{
v44 = 1;
v56 = 0;
}
}
else
{
v56 = 0;
}
LABEL_155:
if ( !a1->m_isPlatformer )
goto LABEL_156;
v77 = a1->getPosition(a1);
cocos2d::CCPoint::CCPoint(&v165, v77);
a1->getPosition(a1);
a1->getPosition(a1);
v78 = a1->getPosition(a1)->y;
v79 = v167.size.height;
v80 = a1->getPosition(a1)->y;
v81 = v167.size.height;
if ( a3 != nullptr && a2 > 0.0 )
{
v82 = GameObject::getLastPosition(a3);
cocos2d::CCPoint::CCPoint(&v166, v82);
((void (__fastcall *)(cocos2d::CCRect *__return_ptr, GameObject *))a3->getRealPosition)(&v169, a3);
v83 = a1->GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( a1->m_isSideways )
v84 = v83->getPosition(a1)->x;
else
v84 = v83->getPosition(a1)->y;
if ( a1->m_isSideways )
{
v85 = v166.y;
v86 = v169.origin.y;
GameObject::getScalePosDelta(a3);
v87 = v170.origin.y;
}
else
{
v85 = v166.x;
v86 = v169.origin.x;
GameObject::getScalePosDelta(a3);
v87 = v170.origin.x;
}
v88 = (float)(v87 + (float)(v86 - v85)) < 0.0;
v89 = (float)((float)(v86 - v85) - v87) > 0.0;
if ( v84 >= v86 )
v90 = v85 - v87;
else
v90 = v85 + v87;
v91 = (float)(v86 - v90) / a2;
}
else
{
v91 = 0.0;
v89 = 0;
v88 = 0;
}
if ( a1->m_isOnSlope || a1->m_wasOnSlope || a1->m_totalTime - a1->m_slopeEndTime < 0.200000003 )
{
v92 = a1->getPosition(a1)->y;
v93 = v167.size.height * 0.5;
v94 = (float)(v92 + (float)(v93 * (float)PlayerObject::flipMod(a1)));
v95 = a1->getPosition(a1)->y;
}
else
{
v94 = (float)(v78 + (float)(v79 * 0.5)) - v156;
v95 = (float)(v80 - (float)(v81 * 0.5)) + v156;
}
if ( !a3 )
{
v96 = 0;
goto LABEL_243;
}
v96 = a3 == a1->m_collidingWithLeft;
if ( a3 != a1->m_collidingWithRight )
{
LABEL_243:
v97 = 0;
goto LABEL_244;
}
v97 = 1;
LABEL_244:
cocos2d::CCRect::CCRect(
&v170,
v167.origin.x,
v167.origin.y + (float)(v154 * 0.5),
v167.size.width,
v167.size.height - v154);
if ( !m_isPassable
&& ((unsigned __int8)cocos2d::CCRect::intersectsRect(&v170, &v168) || v96 || v97)
&& (v94 < v29 && v94 > v31 || v95 < v29 && v95 > v31) )
{
a1->m_scaleXRelated4 = v91;
if ( v96 || (float)(v139 + (float)(width * 0.5)) < a1->getPosition(a1)->x && !v97 )
{
PlayerObject::updateCollideLeft(a1, v143, v11);
v98 = a1->setPosition;
v99 = (float)(v167.size.width * 0.5) + v143;
v161 = v99;
v100 = a1->getPosition(a1);
cocos2d::CCPoint::CCPoint(&v169.origin, v161, v100->y);
v98(a1, &v169.origin);
if ( a1->m_platformerXVelocity < 0.0 && m_holdingLeft <= !v88 )
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;
}
}
if ( a1->m_platformerMovingLeft )
a1->m_maybeSlidingTime = 0;
}
else
{
PlayerObject::updateCollideRight(a1, v140, v11);
v124 = a1->setPosition;
v125 = v140 - (float)(v167.size.width * 0.5);
v162 = v125;
v126 = a1->getPosition(a1);
cocos2d::CCPoint::CCPoint(&v169.origin, v162, v126->y);
v124(a1, &v169.origin);
if ( a1->m_platformerXVelocity > 0.0 && m_holdingRight <= !v89 )
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;
}
}
if ( a1->m_platformerMovingRight )
a1->m_maybeSlidingTime = 0;
}
}
LABEL_156:
v61 = 0;
if ( !v56 || a1->m_isPlatformer || m_isPassable )
return v61;
((void (__fastcall *)(cocos2d::CCRect *__return_ptr, PlayerObject *, float, float))a1->getObjectRect_0)(
&v170,
a1,
0.3,
0.3);
v61 = cocos2d::CCRect::intersectsRect(&v168, &v170);
if ( !v61 )
return 0;
if ( !v44 || !PlayerObject::isSafeFlip(a1, 0.1) )
{
if ( a1->m_isSpider && (cocos2d::CCRect::getMaxX(&v168), v105 = v104, cocos2d::CCRect::getMaxX(&v170), v105 < v106) )
{
if ( PlayerObject::isSafeSpiderFlip(a1, 0.04) )
return v61;
if ( !v11 )
{
LABEL_265:
if ( !a1->m_maybeCanRunIntoBlocks )
{
v134 = GameManager::sharedState();
v134->m_playLayer->destroyPlayer(v134->m_playLayer, a1, nullptr);
return v61;
}
if ( !a1->m_ignoreDamage )
{
a1->m_maybeIsColliding = 1;
return v61;
}
return 0;
}
}
else if ( !v11 )
{
goto LABEL_265;
}
if ( v11->getType(v11) == Breakable )
{
v128 = a1->m_gameLayer;
if ( v128 )
GJBaseGameLayer::destroyObject(v128, v11);
else
GameObject::destroyObject(v11);
return v61;
}
goto LABEL_265;
}
v120 = a1->setPosition;
if ( a1->m_isUpsideDown )
{
v121 = a1->getPosition(a1)->x;
v122 = (float)(v167.size.height * 0.5) + v29;
}
else
{
v121 = a1->getPosition(a1)->x;
v122 = v31 - (float)(v167.size.height * 0.5);
}
v123 = v122;
cocos2d::CCPoint::CCPoint(&v169.origin, v121, v123);
v120(a1, &v169.origin);
PlayerObject::hitGround(a1, v11, 1);
a1->m_isOnGround2 = 0;
return v61;
}