//
// SetupRandAdvTriggerPopup::onAddChance from 0xaf1158 to 0xaf1264 (268 bytes)
//
// 3 xrefs:
// > ??> @ 0x90880
// > SetupRandAdvTriggerPopup::init @ 0xaf0824
// > ??> @ 0x1543dc8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:01:12 +0000
//
__int64 __fastcall SetupRandAdvTriggerPopup::onAddChance(CCTextInputNode **this, cocos2d::CCObject *a2)
{
char *v3; // x23
signed int v4; // w19
char *v5; // x23
int v6; // w21
__int64 v8[2]; // [xsp+40h] [xbp+40h] BYREF
char *v9; // [xsp+50h] [xbp+50h]
CCTextInputNode::getString(*(this + 128), v8);
if ( (v8[0] & 1) != 0 )
{
v3 = v9;
v4 = atoi(v9);
operator delete(v3);
}
else
{
v4 = atoi((const char *)v8 + 1);
}
if ( v4 > 9999 )
v4 = 9999;
if ( v4 < 0 )
v4 = 0;
CCTextInputNode::getString(*(this + 129), v8);
if ( (v8[0] & 1) != 0 )
{
v5 = v9;
v6 = atoi(v9);
operator delete(v5);
}
else
{
v6 = atoi((const char *)v8 + 1);
}
if ( v6 > 0 && v4 > 0 )
{
SetupRandAdvTriggerPopup::addChance((SetupRandAdvTriggerPopup *)this, v4, v6);
SetupRandAdvTriggerPopup::updateGroupIDButtons(this);
}
return _stack_chk_guard;
}