//
// PlayerObject::hitGround from 0x43bcc8 to 0x43c154 (1164 bytes)
//
// 12 xrefs:
// > PlayerObject::hitGroundNoJump @ 0x43c178
// > PlayerObject::collidedWithObjectInternal @ 0x43ccee
// > PlayerObject::collidedWithObjectInternal @ 0x43cec2
// > PlayerObject::collidedWithObjectInternal @ 0x43d274
// > PlayerObject::collidedWithObjectInternal @ 0x43d37e
// > PlayerObject::collidedWithObjectInternal @ 0x43d50c
// > PlayerObject::collidedWithSlopeInternal @ 0x441f12
// > MenuGameLayer::update @ 0x492b2c
// > GJBaseGameLayer::checkCollisions @ 0x5bb370
// > GJBaseGameLayer::checkCollisions @ 0x5bb3bc
// > GJBaseGameLayer::checkCollisions @ 0x5bb408
// > GJBaseGameLayer::checkCollisions @ 0x5bb56e
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:48:22 +0000
//
int __fastcall PlayerObject::hitGround(PlayerObject *this, GameObject *a2, int a3)
{
int v6; // r3
double v7; // d8
double v8; // r0
double v9; // d8
PlayerObject *v10; // r0
int v11; // r1
float *v12; // r5
float v13; // s15
PlayerObject *v14; // r0
int v15; // r1
int v16; // r1
int v17; // r2
cocos2d::CCParticleSystem *v18; // r5
void (__fastcall *v19)(cocos2d::CCParticleSystem *, _DWORD); // r9
float v20; // s18
int v21; // r0
void (__fastcall *v22)(cocos2d::CCParticleSystem *, _BYTE *); // r10
float *v23; // r0
float v24; // s18
float v25; // r11
int v26; // r0
int v27; // r0
int v28; // r2
void (__fastcall *v29)(cocos2d::CCParticleSystem *, _BYTE *); // r7
int v30; // r0
int v31; // r7
int v32; // r2
int v33; // r3
int v34; // r0
int result; // r0
float v36; // s14
float v37; // s15
int v38; // [sp+8h] [bp-24h] BYREF
int v39; // [sp+Ch] [bp-20h]
_BYTE v40[8]; // [sp+10h] [bp-1Ch] BYREF
int v41[3]; // [sp+18h] [bp-14h] BYREF
if ( a2 )
v6 = *((__int16 *)a2 + 439);
else
v6 = 0;
*((_DWORD *)this + 501) = v6;
*((_BYTE *)this + 2248) = 0;
v7 = *((double *)this + 241);
v9 = v7 * (double)PlayerObject::flipMod(this);
if ( !*((_DWORD *)this + 610) || *((_BYTE *)this + 1956) )
goto LABEL_29;
if ( PlayerObject::playerIsFalling(this, -14.0) )
{
v10 = this;
v11 = 5;
}
else if ( PlayerObject::playerIsFalling(this, -8.0) )
{
v10 = this;
v11 = 4;
}
else if ( PlayerObject::playerIsFalling(this, -4.0) )
{
v10 = this;
v11 = 3;
}
else
{
if ( !PlayerObject::playerIsFalling(this, -1.0) )
goto LABEL_17;
v10 = this;
if ( *((_BYTE *)this + 2036) )
v11 = 1;
else
v11 = 2;
}
PlayerObject::gameEventTriggered(v10, v11, *((_DWORD *)this + 501));
LABEL_17:
v12 = (float *)((char *)this + 2456);
if ( *((float *)this + 614) != 0.0 )
{
v13 = fabsf(*v12 - *(float *)((*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)this + 96))(this) + 4));
if ( v13 > 0.0 )
{
if ( v13 > 450.0 )
{
v14 = this;
v15 = 68;
LABEL_27:
PlayerObject::gameEventTriggered(v14, v15, *((_DWORD *)this + 501));
goto LABEL_28;
}
if ( v13 > 300.0 )
{
v14 = this;
v15 = 67;
goto LABEL_27;
}
if ( v13 > 150.0 )
{
v14 = this;
v15 = 66;
goto LABEL_27;
}
if ( v13 > 7.5 )
{
v14 = this;
v15 = 65;
goto LABEL_27;
}
}
LABEL_28:
*v12 = 0.0;
}
LABEL_29:
LODWORD(v8) = this;
PlayerObject::setYVelocity(v8, 0.0, 43);
*((_BYTE *)this + 2233) = 0;
if ( !*((_BYTE *)this + 2036) && !a3 && !PlayerObject::levelFlipping(this) && !*((_BYTE *)this + 1483) )
{
v18 = *((cocos2d::CCParticleSystem **)this + 447);
if ( *((_BYTE *)this + 1780) )
v18 = *((cocos2d::CCParticleSystem **)this + 446);
*((_BYTE *)this + 1780) ^= 1u;
if ( (unsigned int)(*(int (__fastcall **)(cocos2d::CCParticleSystem *))(*(_DWORD *)v18 + 456))(v18) <= 2 )
{
v19 = *(void (__fastcall **)(cocos2d::CCParticleSystem *, _DWORD))(*(_DWORD *)v18 + 504);
v20 = *((float *)this + 448);
v21 = PlayerObject::flipMod(this);
v19(v18, v20 * (float)v21);
v22 = *(void (__fastcall **)(cocos2d::CCParticleSystem *, _BYTE *))(*(_DWORD *)v18 + 524);
v23 = (float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 446) + 520))(*((_DWORD *)this + 446));
v24 = *((float *)this + 449);
v25 = *v23;
v26 = PlayerObject::flipMod(this);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, v25, v24 * (float)v26);
v22(v18, v40);
v27 = PlayerObject::flipMod(this);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, 0.0, (float)(-15 * v27) * *((float *)this + 502));
if ( *((_BYTE *)this + 1963) )
{
v28 = v39;
v39 = v38;
v38 = v28;
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, int))(*(_DWORD *)v18 + 180))(v18, 1119092736);
}
else
{
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, _DWORD))(*(_DWORD *)v18 + 180))(v18, 0);
}
if ( a2 && (*(int (__fastcall **)(GameObject *))(*(_DWORD *)a2 + 900))(a2) == 25 )
{
v36 = 0.0;
if ( *((_BYTE *)this + 1963) )
v36 = 90.0;
v37 = v36 + *((double *)this + 227) * 57.2957802;
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, _DWORD))(*(_DWORD *)v18 + 180))(v18, LODWORD(v37));
}
v29 = *(void (__fastcall **)(cocos2d::CCParticleSystem *, _BYTE *))(*(_DWORD *)v18 + 92);
v30 = (*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)this + 96))(this);
cocos2d::CCPoint::operator+(v40, v30, &v38);
v29(v18, v40);
cocos2d::CCParticleSystem::resetSystem(v18);
}
}
if ( !*((_BYTE *)this + 1240) )
{
PlayerObject::placeStreakPoint(this, v16, v17, *((unsigned __int8 *)this + 1240));
*((_BYTE *)this + 1240) = 1;
}
if ( !*((_BYTE *)this + 2036) && !*((_BYTE *)this + 1996) )
{
if ( *((_BYTE *)this + 1957) )
{
v31 = *((_DWORD *)this + 433);
std::string::basic_string(v41, (int)this + 2400);
CCAnimatedSprite::runAnimation(v31, (int)v41, v32, v33);
std::string::~string((int)v41);
}
else if ( *((_BYTE *)this + 1958) )
{
PlayerObject::playDynamicSpiderRun((int)this);
}
}
*((_BYTE *)this + 2036) = 1;
*((_BYTE *)this + 2065) = a3 ^ 1;
if ( v9 <= 5.0 )
{
*((_BYTE *)this + 1961) = 1;
*((_QWORD *)this + 255) = *((_QWORD *)this + 266);
}
*((_BYTE *)this + 1608) = 1;
*((_DWORD *)this + 544) = 2;
if ( !*((_BYTE *)this + 1955) && (*((_BYTE *)this + 1480) || *((_BYTE *)this + 1945)) )
PlayerObject::stopRotation(this, 1, 17);
if ( *((_BYTE *)this + 1955) && *((_BYTE *)this + 1392) && !*((_BYTE *)this + 1944) )
PlayerObject::stopRotation(this, 1, 16);
if ( *((_BYTE *)this + 1955) && *((_BYTE *)this + 1481) )
PlayerObject::stopRotation(this, 0, 18);
if ( *((_BYTE *)this + 1955) && !*((_BYTE *)this + 1480) )
PlayerObject::runRotateAction(this, 0, 6);
if ( !*((_BYTE *)this + 1955)
&& !PlayerObject::isFlying(this)
&& !*((_BYTE *)this + 1944)
&& !*((_BYTE *)this + 1945)
&& (int)(*(float (__fastcall **)(PlayerObject *))(*(_DWORD *)this + 184))(this) % 90 )
{
PlayerObject::stopRotation(this, 1, 19);
}
v34 = (*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)this + 96))(this);
cocos2d::CCPoint::operator=((char *)this + 2068, v34);
result = PlayerObject::isFlying(this);
if ( !result && *((_BYTE *)this + 1603) )
{
result = PlayerObject::deactivateStreak((int)this, 0);
*((_BYTE *)this + 1889) = 1;
}
*((_BYTE *)this + 1603) = 0;
return result;
}