//
// PlayerObject::disablePlayerControls from 0x14039f3b0 to 0x14039f4fe (334 bytes)
//
// 6 xrefs:
// > GJBaseGameLayer::processOptionsTrigger @ 0x140223e50
// > GJBaseGameLayer::processOptionsTrigger @ 0x140223e72
// > ??> @ 0x1406986bc
// > ??> @ 0x1406986cc
// > ??> @ 0x1406d6830
// > ??> @ 0x1406d683c
//
// 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::disablePlayerControls(PlayerObject *a1)
{
bool v1; // zf
bool m_inputsLocked; // al
__int64 *p_m_holdingButtons; // rdi
bool v5; // cc
double m_platformerXVelocity; // xmm0_8
int v7; // [rsp+40h] [rbp+8h] BYREF
v1 = !a1->m_jumpBuffered;
a1->m_controlsDisabled = 0;
a1->m_inputsLocked = 1;
if ( !v1 )
PlayerObject::placeStreakPoint(a1);
v1 = !a1->m_isDashing;
*(_WORD *)&a1->m_jumpBuffered = 0;
a1->m_touchedPad = 1;
if ( !v1 )
PlayerObject::stopDashing(a1);
m_inputsLocked = a1->m_inputsLocked;
p_m_holdingButtons = (__int64 *)&a1->m_holdingButtons;
if ( !m_inputsLocked )
{
v7 = 2;
*(_BYTE *)sub_1400CDBF0((__int64 *)&a1->m_holdingButtons, &v7) = 0;
m_inputsLocked = a1->m_inputsLocked;
}
if ( !a1->m_controlsDisabled )
{
if ( a1->m_jumpBuffered )
{
PlayerObject::placeStreakPoint(a1);
m_inputsLocked = a1->m_inputsLocked;
p_m_holdingButtons = (__int64 *)&a1->m_holdingButtons;
}
v5 = a1->m_platformerXVelocity >= 0.0;
a1->m_holdingLeft = 0;
if ( !v5 )
a1->m_isMoving = 0;
}
if ( !m_inputsLocked )
{
v7 = 3;
*(_BYTE *)sub_1400CDBF0(p_m_holdingButtons, &v7) = 0;
}
if ( !a1->m_controlsDisabled )
{
if ( a1->m_jumpBuffered )
PlayerObject::placeStreakPoint(a1);
m_platformerXVelocity = a1->m_platformerXVelocity;
a1->m_holdingRight = 0;
if ( m_platformerXVelocity > 0.0 )
a1->m_isMoving = 0;
}
PlayerObject::releaseButton(a1, (PlayerButton)2);
PlayerObject::releaseButton(a1, (PlayerButton)3);
a1->m_inputsLocked = 0;
a1->m_controlsDisabled = 1;
}