//
// GJEffectManager::updateSpawnTriggers from 0x140261da0 to 0x140261fe4 (580 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::loadUpToPosition @ 0x140235b3e
// > GJBaseGameLayer::update @ 0x140238011
// > ??> @ 0x1406d00a4
//
// 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 GJEffectManager::updateSpawnTriggers(GJEffectManager *a1, float a2)
{
unsigned __int64 v3; // r14
int v4; // esi
__int64 v5; // rbx
std::_Vector_val>::pointer Myfirst; // rdi
double v7; // xmm0_8
bool v8; // al
__int64 v9; // r8
GameObject *m_gameObject; // rdx
TriggerEffectDelegate *m_triggerEffectDelegate; // rcx
TriggerEffectDelegate_vtbl *v12; // r10
std::_Vector_val>::pointer Mylast; // rsi
std::_Vector_val>::pointer v14; // rbx
std::_Vector_val>::pointer i; // rdi
std::_Simple_types::value_type *v16; // rsi
std::_Vector_val>::pointer v17; // rdi
std::_Simple_types::value_type *j; // rbx
_QWORD v19[4]; // [rsp+40h] [rbp-48h] BYREF
v3 = a1->m_spawnTriggerActions._Mypair._Myval2._Mylast - a1->m_spawnTriggerActions._Mypair._Myval2._Myfirst;
v4 = 0;
if ( v3 )
{
v5 = 0;
do
{
Myfirst = a1->m_spawnTriggerActions._Mypair._Myval2._Myfirst;
if ( Myfirst[v5].m_finished
|| !Myfirst[v5].m_disabled
&& (v7 = a2 + Myfirst[v5].m_deltaTime,
Myfirst[v5].m_deltaTime = v7,
v8 = v7 >= Myfirst[v5].m_duration,
Myfirst[v5].m_finished = v8) )
{
if ( a1->m_triggerEffectDelegate )
{
sub_14024B270(v19, (__int64)&Myfirst[v5].m_remapKeys);
m_gameObject = Myfirst[v5].m_gameObject;
m_triggerEffectDelegate = a1->m_triggerEffectDelegate;
v12 = m_triggerEffectDelegate->__vftable;
if ( m_gameObject )
((void (__fastcall *)(TriggerEffectDelegate *, GameObject *, __int64, _QWORD *))v12->spawnObject)(
m_triggerEffectDelegate,
m_gameObject,
v9,
v19);
else
((void (__fastcall *)(TriggerEffectDelegate *, _QWORD, bool))v12->spawnGroup)(
m_triggerEffectDelegate,
(unsigned int)Myfirst[v5].m_targetGroupID,
Myfirst[v5].m_spawnOrdered);
sub_14005E430((__int64)v19);
}
}
++v4;
++v5;
}
while ( v4 < v3 );
}
Mylast = a1->m_spawnTriggerActions._Mypair._Myval2._Mylast;
v14 = a1->m_spawnTriggerActions._Mypair._Myval2._Myfirst;
if ( v14 != Mylast )
{
do
{
if ( v14->m_finished )
break;
++v14;
}
while ( v14 != Mylast );
if ( v14 != Mylast )
{
for ( i = v14 + 1; i != Mylast; ++i )
{
if ( !i->m_finished )
{
v14->m_finished = 0;
v14->m_disabled = i->m_disabled;
v14->m_duration = i->m_duration;
v14->m_deltaTime = i->m_deltaTime;
v14->m_targetGroupID = i->m_targetGroupID;
v14->m_triggerUniqueID = i->m_triggerUniqueID;
v14->m_controlID = i->m_controlID;
v14->m_spawnOrdered = i->m_spawnOrdered;
v14->m_gameObject = i->m_gameObject;
sub_14024B1D0(&v14->m_remapKeys._Mypair._Myval2._Myfirst, &i->m_remapKeys._Mypair._Myval2._Myfirst);
++v14;
}
}
if ( v14 != Mylast )
{
v16 = (std::_Simple_types::value_type *)sub_140267DD0(
Mylast,
a1->m_spawnTriggerActions._Mypair._Myval2._Mylast);
v17 = a1->m_spawnTriggerActions._Mypair._Myval2._Mylast;
for ( j = v16; j != v17; ++j )
sub_14005E430((__int64)&j->m_remapKeys);
a1->m_spawnTriggerActions._Mypair._Myval2._Mylast = v16;
}
}
}
}