//
// PlayerObject::enablePlayerControls from 0x14039f500 to 0x14039f698 (408 bytes)
//
// 5 xrefs:
// > GJBaseGameLayer::processOptionsTrigger @ 0x140223e57
// > GJBaseGameLayer::processOptionsTrigger @ 0x140223e79
// > GJBaseGameLayer::loadUpToPosition @ 0x140235c70
// > GJBaseGameLayer::loadUpToPosition @ 0x140235c7c
// > ??> @ 0x1406d6860
//
// 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::enablePlayerControls(PlayerObject *a1)
{
__int64 *p_m_holdingButtons; // rdi
bool v3; // zf
bool v4; // cc
int v5; // [rsp+30h] [rbp+8h] BYREF
p_m_holdingButtons = (__int64 *)&a1->m_holdingButtons;
a1->m_controlsDisabled = 0;
v5 = 2;
if ( *(_BYTE *)sub_1400CDBF0((__int64 *)&a1->m_holdingButtons, &v5) )
{
if ( !a1->m_inputsLocked )
{
v5 = 3;
*(_BYTE *)sub_1400CDBF0(p_m_holdingButtons, &v5) = 0;
v5 = 2;
*(_BYTE *)sub_1400CDBF0(p_m_holdingButtons, &v5) = 1;
}
if ( !a1->m_controlsDisabled )
{
v3 = !a1->m_isSliding;
*(_WORD *)&a1->m_holdingLeft = 257;
if ( !v3 && !a1->m_isSlidingRight )
{
a1->m_isSliding = 0;
a1->m_maybeSlopeForce = 0.0;
}
v4 = a1->m_platformerXVelocity <= 0.0;
LABEL_17:
if ( !v4 )
a1->m_isMoving = 0;
}
}
else
{
v5 = 3;
if ( *(_BYTE *)sub_1400CDBF0(p_m_holdingButtons, &v5) )
{
if ( !a1->m_inputsLocked )
{
v5 = 3;
*(_BYTE *)sub_1400CDBF0(p_m_holdingButtons, &v5) = 1;
v5 = 2;
*(_BYTE *)sub_1400CDBF0(p_m_holdingButtons, &v5) = 0;
}
if ( !a1->m_controlsDisabled )
{
v3 = !a1->m_isSliding;
a1->m_holdingRight = 1;
a1->m_leftPressedFirst = 0;
if ( !v3 && a1->m_isSlidingRight )
{
a1->m_isSliding = 0;
a1->m_maybeSlopeForce = 0.0;
}
v4 = a1->m_platformerXVelocity >= 0.0;
goto LABEL_17;
}
}
}
v5 = 1;
if ( *(_BYTE *)sub_1400CDBF0(p_m_holdingButtons, &v5) )
PlayerObject::pushButton(a1, Jump);
}