//
// cocos2d::extension::CCControlSwitch::setOn_1 from 0x1003a8ad0 to 0x1003a8b3f (111 bytes)
//
// 0 xrefs:
//
// 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 __fastcall cocos2d::extension::CCControlSwitch::setOn_1(cocos2d::extension::CCControlSwitch *a1, bool a2)
{
cocos2d::extension::CCControlSwitch_vtbl *v3; // rdi
bool v4; // si
float v5; // xmm1_4
float v6; // xmm0_4
BYTE1(a1[1].m_nLuaID) = a2;
v3 = a1[1].cocos2d::extension::CCControl::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v4 = !a2;
v5 = *((float *)&v3->getUserData + v4 + 1);
v6 = *(float *)&v3->setUserData;
if ( v6 < v5 )
{
v6 = *((float *)&v3->getUserData + v4 + 1);
if ( v5 >= *((float *)&v3->getUserData + 1) )
v6 = *((float *)&v3->getUserData + 1);
}
*(float *)&v3->getUserData = v6;
sub_1003A7CE0((cocos2d::CCSprite *)v3);
((void (__fastcall *)(cocos2d::extension::CCControlSwitch *, __int64))a1->sendActionsForControlEvents)(a1, 256);
}