//
// RandTriggerGameObject::getRandomGroupID from 0x3eb61c to 0x3eb66a (78 bytes)
//
// 1 xrefs:
// > RandTriggerGameObject::triggerObject @ 0x3ee7aa
//
// 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
//
int RandTriggerGameObject::getRandomGroupID(RandTriggerGameObject *a1)
{
int v2; // r0
ChanceObject *m_finish; // r1
ChanceObject *m_start; // r3
int v5; // r2
int *p_m_groupID; // r4
int m_chance; // r5
RandTriggerGameObject::getTotalChance(a1);
GameToolbox::fast_rand_0_1();
v2 = lroundf();
m_finish = a1->m_chanceObjects.m_finish;
m_start = a1->m_chanceObjects.m_start;
v5 = 0;
while ( 1 )
{
p_m_groupID = &m_start->m_groupID;
if ( m_start == m_finish )
break;
m_chance = m_start->m_chance;
++m_start;
v5 += m_chance;
if ( v5 >= v2 )
return *p_m_groupID;
}
return 0;
}