//
// PlayerObject::preSlopeCollision from 0x440cc4 to 0x4410c2 (1022 bytes)
//
// 1 xrefs:
// > PlayerObject::collidedWithSlopeInternal @ 0x44142a
//
// 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:26 +0000
//
int __fastcall PlayerObject::preSlopeCollision(PlayerObject *this, float a2, GameObject *a3)
{
const cocos2d::CCRect *v6; // r0
const cocos2d::CCRect *v7; // r0
int v8; // r8
float v9; // s16
int LastPosition; // r0
float v11; // s13
float v12; // s14
float *v13; // r0
float v15; // s18
float v16; // s18
int v17; // r8
float v18; // s14
int v19; // r0
int v20; // r0
int v21; // r3
GameObject *v22; // r0
float v23; // s16
GameObject *v24; // r0
float v25; // s16
int v26; // [sp+Ch] [bp-58h]
float v27[2]; // [sp+14h] [bp-50h] BYREF
float v28; // [sp+1Ch] [bp-48h] BYREF
float v29; // [sp+20h] [bp-44h]
float v30; // [sp+24h] [bp-40h]
float v31; // [sp+28h] [bp-3Ch]
_BYTE v32[16]; // [sp+2Ch] [bp-38h] BYREF
_BYTE v33[4]; // [sp+3Ch] [bp-28h] BYREF
float v34; // [sp+40h] [bp-24h]
float v35; // [sp+48h] [bp-1Ch]
unsigned int v36[4]; // [sp+4Ch] [bp-18h] BYREF
if ( *((_DWORD *)a3 + 195) == *((_DWORD *)this + 354) )
return 0;
v6 = (const cocos2d::CCRect *)(*(int (__fastcall **)(GameObject *))(*(_DWORD *)a3 + 664))(a3);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v28, v6);
v7 = (const cocos2d::CCRect *)(*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)this + 664))(this);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v32, v7);
v8 = GameObject::slopeWallLeft(a3);
v26 = GameObject::slopeFloorTop(a3);
if ( *((_BYTE *)this + 2320) )
{
if ( *((_BYTE *)this + 1944) )
{
v9 = 5.0;
}
else
{
v9 = 0.0;
if ( *((_BYTE *)this + 1945) )
v9 = 5.0;
}
}
else
{
v9 = 0.0;
}
(*(void (__fastcall **)(unsigned int *, GameObject *))(*(_DWORD *)a3 + 680))(v36, a3);
LastPosition = GameObject::getLastPosition(a3);
cocos2d::CCPoint::operator-(v27, v36, LastPosition);
v11 = v27[1];
if ( !*((_BYTE *)this + 1963) )
v11 = v27[0];
v12 = *((float *)this + 503) * *((double *)this + 195) * a2;
if ( v8 )
{
if ( *((_BYTE *)this + 1962) && !*((_BYTE *)this + 2320) && v11 >= v12
|| (v13 = (float *)(*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)this + 96))(this), *v13 >= v28) )
{
LABEL_53:
v17 = 0;
v15 = 0.0;
goto LABEL_32;
}
if ( *((_BYTE *)this + 1962) )
{
v15 = 0.0;
if ( !*((_BYTE *)this + 2320) )
v15 = 1.0;
}
else
{
v15 = 0.0;
}
cocos2d::CCRect::CCRect(
(cocos2d::CCRect *)v33,
v28,
(float)(v15 + v9) + v29,
1.0,
v31 - (float)((float)(v15 + v9) + (float)(v15 + v9)));
}
else
{
if ( !*((_BYTE *)this + 1962) && !*((_BYTE *)this + 2320) && v11 <= v12 )
goto LABEL_53;
v16 = *(float *)(*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)this + 96))(this);
if ( v16 <= COERCE_FLOAT(cocos2d::CCRect::getMaxX((cocos2d::CCRect *)&v28)) )
goto LABEL_53;
if ( *((_BYTE *)this + 1962) )
{
v15 = 0.0;
}
else
{
v15 = 0.0;
if ( !*((_BYTE *)this + 2320) )
v15 = 1.0;
}
cocos2d::CCRect::CCRect(
(cocos2d::CCRect *)v33,
(float)(v28 + v30) - 1.0,
(float)(v15 + v9) + v29,
1.0,
v31 - (float)((float)(v15 + v9) + (float)(v15 + v9)));
}
if ( cocos2d::CCRect::intersectsRect((cocos2d::CCRect *)v32, (const cocos2d::CCRect *)v33) )
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v36, (const cocos2d::CCRect *)v33);
PlayerObject::collidedWithObjectInternal((int)this, a2, a3, (cocos2d::CCRect *)v36, 0);
}
v17 = 1;
LABEL_32:
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v33);
v18 = v15 + v15;
if ( !v26 )
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v36, v15 + v28, v29, v30 - v18, 1.0);
cocos2d::CCRect::operator=(v33, v36);
v20 = (*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)this + 96))(this);
if ( *(float *)(v20 + 4) > (float)(v34 + v35) )
goto LABEL_36;
LABEL_54:
if ( cocos2d::CCRect::intersectsRect((cocos2d::CCRect *)v32, (const cocos2d::CCRect *)v33) )
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v36, (const cocos2d::CCRect *)v33);
PlayerObject::collidedWithObjectInternal((int)this, a2, a3, (cocos2d::CCRect *)v36, 0);
}
v17 = 1;
goto LABEL_48;
}
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v36, v15 + v28, (float)(v29 + v31) - 1.0, v30 - v18, 1.0);
cocos2d::CCRect::operator=(v33, v36);
v19 = (*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)this + 96))(this);
if ( *(float *)(v19 + 4) >= (float)(v34 + v35) )
goto LABEL_54;
LABEL_36:
if ( !v17 )
{
v21 = *((unsigned __int8 *)this + 1944);
*((_BYTE *)this + 1393) = 0;
if ( !v21 )
{
if ( (v36[0] = *((_DWORD *)a3 + 195),
*std::unordered_map::operator[]((int)this + 1452, v36) = a3,
(v22 = *((GameObject **)this + 349)) == nullptr)
|| (!*((_BYTE *)v22 + 944) || GameObject::slopeFloorTop(v22))
&& (!*((_BYTE *)a3 + 944) || GameObject::slopeFloorTop(a3))
&& (v23 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 349) + 96))(*((_DWORD *)this + 349)),
v23 > *(float *)(*(int (__fastcall **)(GameObject *))(*(_DWORD *)a3 + 96))(a3))
|| (v24 = *((GameObject **)this + 349), *((_BYTE *)v24 + 944))
&& !GameObject::slopeFloorTop(v24)
&& (v25 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 349) + 96))(*((_DWORD *)this + 349)),
v25 < *(float *)(*(int (__fastcall **)(GameObject *))(*(_DWORD *)a3 + 96))(a3)) )
{
*((_DWORD *)this + 349) = a3;
}
}
}
LABEL_48:
if ( cocos2d::CCRect::intersectsRect((cocos2d::CCRect *)&v28, (const cocos2d::CCRect *)v32) )
return v17;
else
return 1;
}