//
// GJEffectManager::checkCollision from 0x8a43c4 to 0x8a44d4 (272 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::checkCollision @ 0x85b770
// > ??> @ 0xac890
//
// 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 GJEffectManager::checkCollision(GJEffectManager *a1, const int *a2, const int *a3)
{
bool v3; // w3
int v4; // w1
int v6; // w2
int CollisionKey; // w0
std::_Hashtable, std::allocator>, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits>::size_type M_bucket_count; // x5
unsigned __int64 v9; // x7
std::_Hashtable, std::allocator>, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits>::__bucket_type v10; // x1
std::__detail::_Hash_node_base *M_nxt; // x2
int v12; // w1
__int64 v13; // x6
int v15; // [xsp+20h] [xbp+20h] BYREF
int v16; // [xsp+24h] [xbp+24h] BYREF
v3 = 0;
v4 = *a2;
if ( v4 <= 10001 )
{
v6 = *a3;
if ( v4 >= v6 )
{
v15 = v4;
if ( v4 <= v6 )
v6 = v4;
}
else
{
v15 = v6;
v6 = v4;
}
v16 = v6;
CollisionKey = getCollisionKey(&v15, &v16);
M_bucket_count = a1->m_unkMap288._M_h._M_bucket_count;
v9 = CollisionKey % M_bucket_count;
v10 = a1->m_unkMap288._M_h._M_buckets[v9];
if ( !v10 )
return 0;
M_nxt = v10->_M_nxt;
v3 = 0;
if ( v10->_M_nxt )
{
v12 = (int)M_nxt[1]._M_nxt;
v13 = 0;
while ( 1 )
{
if ( CollisionKey == v12 )
{
M_nxt = M_nxt->_M_nxt;
++v13;
if ( !M_nxt )
return v13 != 0;
}
else
{
if ( v13 )
return 1;
M_nxt = M_nxt->_M_nxt;
if ( !M_nxt )
return v13 != 0;
}
v12 = (int)M_nxt[1]._M_nxt;
if ( v9 != v12 % M_bucket_count )
return v13 != 0;
}
}
}
return v3;
}