//
// GJBaseGameLayer::buttonIsRelevant from 0x10014ae70 to 0x10014afd5 (357 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::shouldUseSubstepForButton @ 0x10014ae2e
// > GJBaseGameLayer::update @ 0x1001519c0
//
// 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 __fastcall GJBaseGameLayer::buttonIsRelevant(GJBaseGameLayer *a1, const PlayerButtonCommand *a2)
{
bool m_isPlayer2; // r13
bool v3; // r12
bool m_twoPlayerMode; // r15
GameManager *v5; // rax
char hasActiveDualTouch; // al
bool m_isPush; // cl
bool v8; // al
bool v9; // r12
bool result; // al
PlayerObject *m_player1; // r15
int v12; // ecx
bool isFlying; // cl
PlayerObject *m_player2; // r14
if ( a2->m_button != Jump )
return 0;
m_isPlayer2 = a2->m_isPlayer2;
v3 = !m_isPlayer2;
m_twoPlayerMode = a1->m_levelSettings->m_twoPlayerMode;
if ( !a1->m_isPlatformer && !a1->m_useReplay )
{
v5 = GameManager::sharedState();
if ( GameManager::getGameVariable(v5, "0010") )
v3 = m_isPlayer2;
}
hasActiveDualTouch = GJEffectManager::hasActiveDualTouch(a1->m_effectManager);
m_isPush = a2->m_isPush;
if ( !m_isPush )
hasActiveDualTouch &= a1->m_dualTouchTrigger;
if ( !v3 && hasActiveDualTouch )
return 0;
v8 = v3 || !m_twoPlayerMode;
if ( a1->m_dualTouchTrigger || !a1->m_gameState.m_isDualMode )
{
v9 = 0;
if ( !v8 )
goto LABEL_23;
}
else
{
v9 = !m_twoPlayerMode || !v3;
if ( !v8 )
{
LABEL_23:
if ( v9 )
{
LABEL_24:
m_player2 = a1->m_player2;
if ( m_isPush && (unsigned int)sub_100720070(m_player2->m_touchingRings)
|| PlayerObject::isFlying(m_player2)
|| a2->m_isPush && m_player2->m_isOnGround )
{
return 1;
}
}
return 0;
}
}
m_player1 = a1->m_player1;
if ( !m_isPush || (v12 = sub_100720070(m_player1->m_touchingRings), result = 1, !v12) )
{
isFlying = PlayerObject::isFlying(m_player1);
result = 1;
if ( !isFlying )
{
m_isPush = a2->m_isPush;
if ( !m_isPush )
goto LABEL_23;
result = m_player1->m_isOnGround;
if ( !result && v9 )
goto LABEL_24;
}
}
return result;
}