//
// GJBaseGameLayer::buttonIsRelevant from 0x140231e80 to 0x140231ff0 (368 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::update @ 0x140237da8
// > ??> @ 0x1406cdefc
// > ??> @ 0x1406cdf08
//
// 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
//
// Hidden C++ exception states: #wind=1
bool GJBaseGameLayer::buttonIsRelevant(GJBaseGameLayer *a1, const PlayerButtonCommand *a2)
{
bool m_isPlayer2; // di
bool v5; // bp
bool m_twoPlayerMode; // r14
GameManager *v7; // rcx
GJEffectManager *m_effectManager; // rax
_BYTE *p_m_disabled; // rcx
std::_Vector_val>::pointer Mylast; // rdx
char v11; // al
char v12; // di
void *v14; // [rsp+48h] [rbp+10h]
if ( a2->m_button != Jump )
return 0;
m_isPlayer2 = a2->m_isPlayer2;
v5 = !m_isPlayer2;
m_twoPlayerMode = a1->m_levelSettings->m_twoPlayerMode;
if ( !a1->m_isPlatformer && !a1->m_useReplay )
{
v7 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v14 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v14);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v7 = (GameManager *)qword_1406C2ED8;
}
if ( GameManager::getGameVariable(v7, "0010") )
v5 = m_isPlayer2;
}
m_effectManager = a1->m_effectManager;
p_m_disabled = &m_effectManager->m_unkVector1e0._Mypair._Myval2._Myfirst->m_disabled;
Mylast = m_effectManager->m_unkVector1e0._Mypair._Myval2._Mylast;
if ( p_m_disabled == (_BYTE *)Mylast )
{
LABEL_12:
v11 = 0;
}
else
{
while ( !p_m_disabled[28] || *p_m_disabled )
{
p_m_disabled += 56;
if ( p_m_disabled == (_BYTE *)Mylast )
goto LABEL_12;
}
v11 = 1;
}
if ( !a2->m_isPush && !a1->m_dualTouchTrigger )
v11 = 0;
if ( v5 )
{
v12 = 0;
LABEL_22:
v11 = 1;
goto LABEL_23;
}
if ( v11 )
return 0;
v12 = 0;
if ( !m_twoPlayerMode )
goto LABEL_22;
LABEL_23:
if ( !a1->m_dualTouchTrigger && a1->m_gameState.m_isDualMode && (!v5 || !m_twoPlayerMode) )
v12 = 1;
if ( v11 && sub_140231E00((__int64)a1->m_player1, (__int64)a2) )
return 1;
if ( v12 )
return sub_140231E00((__int64)a1->m_player2, (__int64)a2);
return 0;
}