//
// GJBaseGameLayer::canBeActivatedByPlayer from 0x1402178c0 to 0x1402179c4 (260 bytes)
//
// 21 xrefs:
// > GJBaseGameLayer::collisionCheckObjects @ 0x140214c50
// > GJBaseGameLayer::collisionCheckObjects @ 0x140214d0d
// > GJBaseGameLayer::collisionCheckObjects @ 0x140214dca
// > GJBaseGameLayer::collisionCheckObjects @ 0x140214e8f
// > GJBaseGameLayer::collisionCheckObjects @ 0x140214f6a
// > GJBaseGameLayer::collisionCheckObjects @ 0x140215022
// > GJBaseGameLayer::collisionCheckObjects @ 0x1402150e7
// > GJBaseGameLayer::collisionCheckObjects @ 0x14021519f
// > GJBaseGameLayer::collisionCheckObjects @ 0x1402152a6
// > GJBaseGameLayer::collisionCheckObjects @ 0x14021535e
// > GJBaseGameLayer::collisionCheckObjects @ 0x140215458
// > GJBaseGameLayer::collisionCheckObjects @ 0x140215552
// > GJBaseGameLayer::collisionCheckObjects @ 0x14021558d
// > GJBaseGameLayer::collisionCheckObjects @ 0x140215613
// > GJBaseGameLayer::collisionCheckObjects @ 0x1402156a6
// > GJBaseGameLayer::collisionCheckObjects @ 0x140215739
// > GJBaseGameLayer::collisionCheckObjects @ 0x1402157bf
// > GJBaseGameLayer::collisionCheckObjects @ 0x140215849
// > GJBaseGameLayer::collisionCheckObjects @ 0x140215930
// > GJBaseGameLayer::bumpPlayer @ 0x1402179e8
// > ??> @ 0x1406cd1ac
//
// 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 GJBaseGameLayer::canBeActivatedByPlayer(GJBaseGameLayer *a1, PlayerObject *a2, EffectGameObject *a3)
{
std::_Tree_val, int>>>::_Nodeptr Myhead; // rdx
int m_uniqueID; // r9d
int v8; // r8d
std::_Tree_node, int>, void *>::_Nodeptr Parent; // rax
int v11; // [rsp+38h] [rbp+10h] BYREF
int v12; // [rsp+3Ch] [rbp+14h]
if ( !a3->canMultiActivate(a3, a2->m_isPlatformer) )
goto LABEL_14;
Myhead = a1->m_gameState.m_activatedObjectIDs._Mypair._Myval2._Myval2._Myhead;
m_uniqueID = a3->m_uniqueID;
v8 = a2->m_uniqueID;
Parent = Myhead->_Parent;
while ( !Parent->_Isnil )
{
if ( Parent->_Myval.first.first < m_uniqueID
|| Parent->_Myval.first.first <= m_uniqueID && Parent->_Myval.first.second < v8 )
{
Parent = Parent->_Right;
}
else
{
Myhead = Parent;
Parent = Parent->_Left;
}
}
if ( Myhead->_Isnil
|| m_uniqueID < Myhead->_Myval.first.first
|| m_uniqueID <= Myhead->_Myval.first.first && v8 < Myhead->_Myval.first.second )
{
LABEL_14:
v11 = a3->m_uniqueID;
v12 = a2->m_uniqueID;
*(_DWORD *)sub_1401D0800((unsigned __int64)&a1->m_gameState.m_activatedObjectIDs, &v11) = a1->m_gameState.m_commandIndex;
return !a3->hasBeenActivatedByPlayer(a3, a2);
}
else
{
v11 = a3->m_uniqueID;
v12 = v8;
*(_DWORD *)sub_1401D0800((unsigned __int64)&a1->m_gameState.m_activatedObjectIDs, &v11) = a1->m_gameState.m_commandIndex;
return 0;
}
}