//
// GJBaseGameLayer::playerTouchedObject from 0x10012a020 to 0x10012a109 (233 bytes)
//
// 0 xrefs:
//
// 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 __fastcall GJBaseGameLayer::playerTouchedObject(GJBaseGameLayer *a1, PlayerObject *a2, GameObject *a3)
{
__int64 m_uniqueID; // r12
__int64 v4; // r13
unsigned int m_commandIndex; // ecx
std::__tree_end_node *>::pointer left; // rax
std::__compressed_pair *>> *p_pair1; // r15
char *v8; // r14
int v9; // eax
int v10; // eax
std::__tree_end_node *> *v11; // rax
char *v12; // [rsp+8h] [rbp-38h]
unsigned int v13; // [rsp+14h] [rbp-2Ch]
m_uniqueID = (unsigned int)a3->m_uniqueID;
v4 = (unsigned int)a2->m_uniqueID;
m_commandIndex = a1->m_gameState.m_commandIndex;
left = a1->m_gameState.m_activatedObjectIDs.__tree_.__pair1_.__value_.__left_;
if ( left )
{
while ( 1 )
{
v8 = (char *)left;
v9 = *((_DWORD *)left + 7);
if ( (int)m_uniqueID < v9 )
goto LABEL_3;
if ( (int)m_uniqueID > v9 )
{
LABEL_8:
left = *((std::__tree_end_node *>::pointer *)v8 + 1);
if ( !left )
{
p_pair1 = (std::__compressed_pair *>> *)(v8 + 8);
goto LABEL_10;
}
}
else
{
v10 = *((_DWORD *)v8 + 8);
if ( (int)v4 >= v10 )
{
if ( (int)v4 <= v10 )
goto LABEL_13;
goto LABEL_8;
}
LABEL_3:
left = *(std::__tree_end_node *>::pointer *)v8;
p_pair1 = (std::__compressed_pair *>> *)v8;
if ( !*(_QWORD *)v8 )
goto LABEL_10;
}
}
}
p_pair1 = &a1->m_gameState.m_activatedObjectIDs.__tree_.__pair1_;
v8 = (char *)&a1->m_gameState.m_activatedObjectIDs.__tree_.__pair1_;
LABEL_10:
v13 = a1->m_gameState.m_commandIndex;
v12 = v8;
v8 = (char *)operator new(0x28u);
*(_QWORD *)(v8 + 28) = m_uniqueID | (v4 << 32);
*((_DWORD *)v8 + 9) = 0;
*(_OWORD *)v8 = 0;
*((_QWORD *)v8 + 2) = v12;
p_pair1->__value_.__left_ = (std::__tree_end_node *>::pointer)v8;
v11 = (std::__tree_end_node *> *)a1->m_gameState.m_activatedObjectIDs.__tree_.__begin_node_->__left_;
if ( v11 )
a1->m_gameState.m_activatedObjectIDs.__tree_.__begin_node_ = v11;
sub_100054DD0((__int64 *)a1->m_gameState.m_activatedObjectIDs.__tree_.__pair1_.__value_.__left_, (__int64 *)v8);
++a1->m_gameState.m_activatedObjectIDs.__tree_.__pair3_.__value_;
m_commandIndex = v13;
LABEL_13:
*((_DWORD *)v8 + 9) = m_commandIndex;
}