//
// SpawnTriggerGameObject::customObjectSetup from 0x10038efa0 to 0x10038f2bc (796 bytes)
//
// 1 xrefs:
// > ??> @ 0x1007f8658
//
// 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 SpawnTriggerGameObject::customObjectSetup(
SpawnTriggerGameObject *a1,
std::vector *a2,
std::vector *a3)
{
std::__vector_base::pointer begin; // x21
std::__vector_base::pointer capacitym1; // x0
int v8; // w0
float v9; // s8
float v10; // s0
std::__vector_base::pointer v11; // x0
std::__vector_base::pointer v12; // x0
void *v13; // x8
std::__vector_base::pointer v14; // x0
void *v15; // x8
std::__vector_base::pointer v16; // x0
void *v17; // x8
std::__vector_base::pointer v18; // x0
std::__vector_base::pointer v19; // x8
std::string::size_type size; // x9
char v21; // w8
cocos2d::CCArray *v22; // x20
unsigned int v23; // w22
std::vector *p_m_remapObjects; // x21
cocos2d::CCString *v25; // x0
int v26; // w23
unsigned int v27; // w22
cocos2d::CCString *v28; // x0
unsigned int v29; // w0
unsigned int v30; // w24
std::__vector_base::pointer end; // x8
ChanceObject *value; // x9
ChanceObject *v33; // x27
std::__vector_base::pointer v34; // x1
signed __int64 v35; // x2
__int64 v36; // x27
unsigned __int64 v37; // x8
__int64 v38; // x9
char *v39; // x0
unsigned __int64 v40; // x1
ChanceObject *v41; // x10
ChanceObject *v42; // x28
ChanceObject *v43; // x23
std::__vector_base::pointer v44; // x0
std::string __p; // [xsp+0h] [xbp-80h] BYREF
EffectGameObject::customObjectSetup(a1, a2, a3);
begin = a3->__begin_;
if ( begin[51] )
{
capacitym1 = a2->__begin_ + 51;
if ( a2->__begin_[51].m_data.m_short.shortStorage.__elems_[22] < 0 )
capacitym1 = (std::__vector_base::pointer)capacitym1->m_data.m_long.capacitym1;
v8 = atoi((const char *)capacitym1);
}
else
{
v8 = 0;
}
a1->m_targetGroupID = v8;
v9 = 0.0;
v10 = 0.0;
if ( begin[63] )
{
v11 = a2->__begin_ + 63;
if ( a2->__begin_[63].m_data.m_short.shortStorage.__elems_[22] < 0 )
v11 = (std::__vector_base::pointer)v11->m_data.m_long.capacitym1;
v10 = atof((const char *)v11);
}
a1->m_spawnDelay = v10;
if ( begin[556] )
{
v12 = a2->__begin_ + 556;
if ( a2->__begin_[556].m_data.m_short.shortStorage.__elems_[22] < 0 )
v12 = (std::__vector_base::pointer)v12->m_data.m_long.capacitym1;
v9 = atof((const char *)v12);
}
a1->m_delayRange = v9;
v13 = begin[102];
if ( v13 )
{
v14 = a2->__begin_ + 102;
if ( a2->__begin_[102].m_data.m_short.shortStorage.__elems_[22] < 0 )
v14 = (std::__vector_base::pointer)v14->m_data.m_long.capacitym1;
LOBYTE(v13) = atoi((const char *)v14) != 0;
}
a1->m_previewDisable = (char)v13;
v15 = begin[441];
if ( v15 )
{
v16 = a2->__begin_ + 441;
if ( a2->__begin_[441].m_data.m_short.shortStorage.__elems_[22] < 0 )
v16 = (std::__vector_base::pointer)v16->m_data.m_long.capacitym1;
LOBYTE(v15) = atoi((const char *)v16) != 0;
}
a1->m_spawnOrdered = (char)v15;
v17 = begin[581];
if ( v17 )
{
v18 = a2->__begin_ + 581;
if ( a2->__begin_[581].m_data.m_short.shortStorage.__elems_[22] < 0 )
v18 = (std::__vector_base::pointer)v18->m_data.m_long.capacitym1;
LOBYTE(v17) = atoi((const char *)v18) != 0;
}
a1->m_resetRemap = (char)v17;
if ( begin[442] )
{
v19 = a2->__begin_;
if ( a2->__begin_[442].m_data.m_short.shortStorage.__elems_[22] < 0 )
sub_1000097D0(&__p, (void *)v19[442].m_data.m_long.capacitym1, v19[442].m_data.m_long.size);
else
__p = v19[442];
}
else
{
sub_100009900(&__p, "");
}
size = (unsigned __int8)__p.m_data.m_short.shortStorage.__elems_[22];
v21 = __p.m_data.m_short.shortStorage.__elems_[22];
if ( __p.m_data.m_short.shortStorage.__elems_[22] < 0 )
size = __p.m_data.m_long.size;
if ( size )
{
v22 = (cocos2d::CCArray *)sub_100389CF4((const std::string *)&__p);
v23 = 0;
p_m_remapObjects = &a1->m_remapObjects;
while ( v23 < (unsigned int)sub_10024A36C((__int64)v22) )
{
v25 = cocos2d::CCArray::stringAtIndex(v22, v23);
v26 = cocos2d::CCString::intValue(v25);
v27 = v23 + 1;
v28 = cocos2d::CCArray::stringAtIndex(v22, v27);
v29 = cocos2d::CCString::intValue(v28);
v30 = v29;
end = a1->m_remapObjects.__end_;
value = a1->m_remapObjects.__end_cap_.__value_;
if ( end >= value )
{
v34 = p_m_remapObjects->__begin_;
v35 = (char *)end - (char *)p_m_remapObjects->__begin_;
v36 = v35 >> 4;
v37 = (v35 >> 4) + 1;
if ( v37 >> 60 )
sub_10000A5F8();
v38 = (char *)value - (char *)v34;
if ( v38 >> 3 > v37 )
v37 = v38 >> 3;
if ( (unsigned __int64)v38 >= 0x7FFFFFFFFFFFFFF0LL )
v37 = 0xFFFFFFFFFFFFFFFLL;
if ( v37 )
{
v39 = (char *)sub_10002F8CC((__int64)&a1->m_remapObjects, v37);
v37 = v40;
v34 = a1->m_remapObjects.__begin_;
v35 = (char *)a1->m_remapObjects.__end_ - (char *)v34;
}
else
{
v39 = nullptr;
}
v41 = (ChanceObject *)&v39[16 * v36];
v42 = (ChanceObject *)&v39[16 * v37];
v41->m_groupID = v26;
v41->m_oldGroupID = v26;
v41->m_chance = v30;
v41->m_unk00c = 0;
v33 = v41 + 1;
v43 = &v41[-(v35 >> 4)];
memcpy(v43, v34, v35);
v44 = a1->m_remapObjects.__begin_;
a1->m_remapObjects.__begin_ = v43;
a1->m_remapObjects.__end_ = v33;
a1->m_remapObjects.__end_cap_.__value_ = v42;
if ( v44 )
operator delete(v44);
}
else
{
end->m_groupID = v26;
end->m_oldGroupID = v26;
v33 = end + 1;
*(_QWORD *)&end->m_chance = v29;
}
a1->m_remapObjects.__end_ = v33;
v23 = v27 + 1;
}
v21 = __p.m_data.m_short.shortStorage.__elems_[22];
}
if ( v21 < 0 )
operator delete((void *)__p.m_data.m_long.capacitym1);
}