//
// PlayerObject::redirectPlayerForce from 0x438bc0 to 0x438d56 (406 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::teleportPlayer @ 0x5b8650
//
// 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:20 +0000
//
_BYTE *__fastcall PlayerObject::redirectPlayerForce(PlayerObject *this, float a2, float a3, float a4, float a5)
{
float v8; // s17
float v9; // s13
float v10; // s15
float v11; // r0
float v12; // r2
float v13; // r0
float v14; // s20
float v15; // s19
float v16; // r0
float Length; // r0
float v18; // s15
float v19; // s18
float v20; // r0
float v21; // r2
float x; // [sp+4h] [bp-14h] BYREF
float y; // [sp+8h] [bp-10h]
float v25[2]; // [sp+Ch] [bp-Ch] BYREF
v8 = a2 * 0.017453;
v9 = *((double *)this + 275);
v10 = *((double *)this + 241);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&x, v9, v10);
v11 = atan2f(y, x);
v13 = COERCE_FLOAT(GJBaseGameLayer::convertToClosestDirection(COERCE_GJBASEGAMELAYER_(v8 - v11), 3.1416, v12));
v14 = v13;
if ( v13 != 0.0 )
{
v15 = cosf(v13);
v16 = sinf(v14);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v25,
(float)(x * v15) - (float)(y * v16),
(float)(x * v16) + (float)(y * v15));
cocos2d::CCPoint::operator=(&x, v25);
}
cocos2d::CCPoint::operator*(v25, &x, LODWORD(a3));
cocos2d::CCPoint::operator=(&x, v25);
Length = cocos2d::CCPoint::getLength((cocos2d::CCPoint *)&x);
if ( a5 > 0.0 && Length > a5 )
{
v18 = a5 / Length;
goto LABEL_11;
}
if ( a4 > 0.0 && Length < a4 )
{
if ( Length == 0.0 )
{
v19 = cosf(v8);
v20 = sinf(v8);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, a4 * v19, a4 * v20);
LABEL_12:
cocos2d::CCPoint::operator=(&x, v25);
goto LABEL_13;
}
v18 = a4 / Length;
LABEL_11:
cocos2d::CCPoint::operator*(v25, &x, LODWORD(v18));
goto LABEL_12;
}
LABEL_13:
if ( *((_BYTE *)this + 1963) )
{
v21 = y;
y = x;
x = v21;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, (const cocos2d::CCPoint *)&x);
return PlayerObject::updatePlayerForce(this, v25, 0);
}