//
// BrowseSmartKeyLayer::addChanceToSelected from 0x53fcc0 to 0x53fd64 (164 bytes)
//
// 1 xrefs:
// > BrowseSmartKeyLayer::onButton @ 0x53fda8
//
// 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 BrowseSmartKeyLayer::addChanceToSelected(BrowseSmartKeyLayer *a1, int a2, bool a3)
{
unsigned int v5; // r4
cocos2d::CCArray *AllSelectedBlocks; // r7
int v7; // r0
int v8; // r11
int v9; // r0
int PrefabWithID; // r11
int v11; // r3
GJSmartTemplate *m_template; // [sp+0h] [bp-14h]
_BOOL4 v13; // [sp+4h] [bp-10h]
std::string v14; // [sp+8h] [bp-Ch] BYREF
v13 = a3;
v5 = 0;
AllSelectedBlocks = BrowseSmartKeyLayer::getAllSelectedBlocks(a1);
while ( v5 < cocos2d::CCArray::count(AllSelectedBlocks) )
{
v7 = cocos2d::CCArray::objectAtIndex(AllSelectedBlocks, v5);
m_template = a1->m_template;
v8 = v7;
sub_775C20(&v14);
v9 = (*(int (__fastcall **)(int))(*(_DWORD *)v8 + 32))(v8);
PrefabWithID = GJSmartTemplate::getPrefabWithID((int)m_template, &v14, v9);
sub_774008(&v14);
if ( PrefabWithID )
{
if ( v13 )
v11 = 0;
else
v11 = *(_DWORD *)(PrefabWithID + 64) + a2;
*(_DWORD *)(PrefabWithID + 64) = v11;
}
++v5;
}
BrowseSmartKeyLayer::updateChanceValues(a1);
}