//
// CollisionBlockPopup::onNextItemID from 0x1002868f0 to 0x100286a74 (388 bytes)
//
// 1 xrefs:
// > CollisionBlockPopup::init @ 0x1002863b2
//
// 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 CollisionBlockPopup::onNextItemID(CollisionBlockPopup *a1, cocos2d::CCObject *a2)
{
LevelEditorLayer *m_levelEditorLayer; // rdi
std::unordered_set *v4; // rsi
std::__hash_node_base *>::__next_pointer next; // rdi
std::__hash_node_base *> *v6; // r14
void *value; // rdi
int m_blockID; // ecx
int v9; // eax
EffectGameObject *m_gameObject; // rcx
unsigned int v11; // r14d
__int64 m_gameObjects; // r14
unsigned int v13; // r15d
GameObject *v14; // rax
std::unordered_set v15; // [rsp+0h] [rbp-40h] BYREF
m_levelEditorLayer = GameManager::sharedState()->m_levelEditorLayer;
memset(&v15, 0, 32);
v15.__table_.__p3_.__value_ = 1.0;
v4 = &v15;
a1->m_blockID = LevelEditorLayer::getNextFreeBlockID(m_levelEditorLayer, &v15);
next = v15.__table_.__p1_.__value_.__next_;
if ( v15.__table_.__p1_.__value_.__next_ )
{
do
{
v6 = next->__next_;
operator delete(next);
next = v6;
}
while ( v6 );
}
value = v15.__table_.__bucket_list_.__ptr_.__value_;
v15.__table_.__bucket_list_.__ptr_.__value_ = nullptr;
if ( value )
operator delete(value);
m_blockID = 0;
if ( a1->m_blockID > 0 )
m_blockID = a1->m_blockID;
v9 = 9999;
if ( m_blockID < 9999 )
v9 = m_blockID;
a1->m_blockID = v9;
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
{
m_gameObject->m_itemID = v9;
goto LABEL_16;
}
value = a1->m_gameObjects;
if ( value && (unsigned int)sub_100720070(value) )
{
v11 = 0;
do
{
v4 = (std::unordered_set *)v11;
*(_DWORD *)(sub_1007200C0(a1->m_gameObjects, v11++) + 1680) = a1->m_blockID;
value = a1->m_gameObjects;
}
while ( v11 < (unsigned int)sub_100720070(value) );
}
if ( a1->m_gameObject )
{
LABEL_16:
m_gameObjects = sub_10071F9E0(value, v4);
sub_10071FCD0(m_gameObjects, a1->m_gameObject);
if ( !m_gameObjects )
goto LABEL_20;
goto LABEL_17;
}
m_gameObjects = (__int64)a1->m_gameObjects;
if ( !m_gameObjects )
goto LABEL_20;
LABEL_17:
if ( (unsigned int)sub_100720070(m_gameObjects) )
{
v13 = 0;
do
{
v14 = (GameObject *)sub_1007200C0(m_gameObjects, v13);
LevelEditorLayer::updateObjectLabel(v14);
++v13;
}
while ( v13 < (unsigned int)sub_100720070(m_gameObjects) );
}
LABEL_20:
CollisionBlockPopup::updateTextInputLabel(a1);
}