//
// PlayerObject::redirectDash from 0x62a520 to 0x62a70c (492 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::teleportPlayer @ 0x889e9c
// > ??> @ 0xc6e40
//
// 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
//
void PlayerObject::redirectDash(PlayerObject *a1, float a2)
{
float m_dashX; // s0
float m_dashY; // s1
float v6; // s0
float v7; // s0
float v8; // s8
float v9; // s0
_BOOL4 m_isSideways; // w1
float v11; // s0
int v12; // w0
int v13; // w2
float y; // s1
float v15; // s2
int v16; // w2
float v17; // s0
float v18; // s9
float v19; // s0
float v20; // s0
float v21; // s1
cocos2d::CCPoint x; // [xsp+58h] [xbp+58h] BYREF
cocos2d::CCPoint v23; // [xsp+60h] [xbp+60h] BYREF
if ( a1->m_isDashing )
{
m_dashX = a1->m_dashX;
m_dashY = a1->m_dashY;
cocos2d::CCPoint::CCPoint(&x, m_dashX, m_dashY);
v6 = atan2f(x.y, x.x);
v7 = GJBaseGameLayer::convertToClosestDirection(-(float)(v6 - (float)(a2 * 0.017453)), 3.1416);
v8 = v7;
if ( v7 != 0.0 )
{
v18 = cosf(v7);
v19 = sinf(v8);
cocos2d::CCPoint::CCPoint(
&v23,
-(float)((float)(v19 * x.y) - (float)(v18 * x.x)),
(float)(v19 * x.x) + (float)(v18 * x.y));
cocos2d::CCPoint::operator=(&x, v20, v21);
}
v9 = atan2f(x.y, x.x);
m_isSideways = a1->m_isSideways;
v11 = -(float)(v9 * 57.296);
v12 = (int)v11;
a1->m_dashAngle = v11;
if ( m_isSideways )
{
v16 = (v12 - 90) % 360;
if ( v16 < 0 )
v16 += 360;
y = x.y;
a1->m_dashAngle = (double)-v16;
v17 = x.x;
x.x = y;
v15 = v17;
x.y = v17;
}
else
{
v13 = v12 % 360;
if ( v12 % 360 < 0 )
v13 += 360;
y = x.x;
v15 = x.y;
a1->m_dashAngle = (double)-v13;
}
a1->m_dashX = y;
a1->m_dashY = v15;
if ( y < 0.0 )
{
PlayerObject::doReversePlayer(a1, !m_isSideways);
}
else if ( y > 0.0 )
{
PlayerObject::doReversePlayer(a1, m_isSideways);
}
PlayerObject::updateDashArt(a1);
}
}