//
// GJBaseGameLayer::spawnObject from 0x14021b030 to 0x14021b1b5 (389 bytes)
//
// 4 xrefs:
// > ??> @ 0x140566708
// > ??> @ 0x140585980
// > ??> @ 0x1405ca548
// > ??> @ 0x1406cd3b0
//
// 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
//
// Hidden C++ exception states: #wind=1
void GJBaseGameLayer::spawnObject(GJBaseGameLayer *a1, GameObject *a2, double a3, std::vector *const a4)
{
GJBaseGameLayer *v7; // rsi
std::unordered_map v8; // [rsp+20h] [rbp-58h] BYREF
if ( a2->m_classType == Effect )
{
if ( !a2->m_isGroupDisabled
&& (LOBYTE(a2[1].CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable)
|| !a2->hasBeenActivated(a2))
&& BYTE1(a2[1].m_sAdditionalTransform.d)
&& GameObject::isSpawnableTrigger(a2) )
{
if ( a4->_Mypair._Myval2._Myfirst == a4->_Mypair._Myval2._Mylast )
{
((void (__fastcall *)(GameObject *))a2->triggerActivated)(a2);
if ( a2->m_objectID == 1268 )
{
SpawnTriggerGameObject::updateRemapKeys((SpawnTriggerGameObject *)a2, a4);
*(double *)&a2[1].m_sQuad.br.texCoords.v = a3;
}
a2->triggerObject(a2, (GJBaseGameLayer *)&a1[-1].m_calcCollisionBlockObjects._Mypair._Myval2._Mylast, 0, a4);
}
else
{
sub_14005D660((__int64)&v8);
v7 = (GJBaseGameLayer *)((char *)a1 - 408);
GJBaseGameLayer::applyRemap(v7, (EffectGameObject *)a2, a4, &v8);
((void (__fastcall *)(GameObject *))a2->triggerActivated)(a2);
if ( a2->m_objectID == 1268 )
{
SpawnTriggerGameObject::updateRemapKeys((SpawnTriggerGameObject *)a2, a4);
*(double *)&a2[1].m_sQuad.br.texCoords.v = a3;
}
a2->triggerObject(a2, v7, 0, a4);
if ( a4->_Mypair._Myval2._Myfirst != a4->_Mypair._Myval2._Mylast )
GJBaseGameLayer::restoreRemap(v7, (EffectGameObject *)a2, &v8);
sub_14005D100((__int64)&v8._Vec);
sub_14005D870((void **)&v8._List._Mypair._Myval2._Myhead);
}
}
}
else
{
a2->animationTriggered(a2);
}
}