//
// PlayerObject::switchedDirTo from 0x140397e30 to 0x140397f3f (271 bytes)
//
// 4 xrefs:
// > PlayerObject::pushButton @ 0x1403981b0
// > ??> @ 0x140697f0c
// > ??> @ 0x140697f1c
// > ??> @ 0x1406d6488
//
// 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
//
bool PlayerObject::switchedDirTo(PlayerObject *a1, PlayerButton a2)
{
bool m_isSliding; // al
bool v6; // cc
int v7; // [rsp+30h] [rbp+8h] BYREF
if ( !a1->m_inputsLocked )
{
v7 = 3;
*(_BYTE *)sub_1400CDBF0((__int64 *)&a1->m_holdingButtons, &v7) = a2 == 3;
v7 = 2;
*(_BYTE *)sub_1400CDBF0((__int64 *)&a1->m_holdingButtons, &v7) = a2 == 2;
}
if ( a1->m_controlsDisabled )
return 0;
m_isSliding = a1->m_isSliding;
if ( a2 == 3 )
{
a1->m_holdingRight = 1;
a1->m_leftPressedFirst = 0;
if ( m_isSliding && a1->m_isSlidingRight )
{
a1->m_isSliding = 0;
a1->m_maybeSlopeForce = 0.0;
}
v6 = a1->m_platformerXVelocity >= 0.0;
}
else
{
*(_WORD *)&a1->m_holdingLeft = 257;
if ( m_isSliding && !a1->m_isSlidingRight )
{
a1->m_isSliding = 0;
a1->m_maybeSlopeForce = 0.0;
}
v6 = a1->m_platformerXVelocity <= 0.0;
}
if ( !v6 )
a1->m_isMoving = 0;
return 1;
}