//
// SupportLayer::onGetReward from 0x7db4a4 to 0x7db5e0 (316 bytes)
//
// 3 xrefs:
// > ??> @ 0x92730
// > SupportLayer::customSetup @ 0x7ddb1c
// > ??> @ 0x122d000
//
// 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 SupportLayer::onGetReward(SupportLayer *a1, cocos2d::CCObject *a2)
{
GameStatsManager *v3; // x22
GJRewardItem *v4; // x20
CCMenuItemSpriteExtra **p_m_rightChest; // x0
RewardUnlockLayer *v6; // x22
unsigned int *p_m_openLayer; // x2
int m_openLayer; // w1
RewardsPage *v9; // [xsp+40h] [xbp+40h] BYREF
v3 = GameStatsManager::sharedState();
sub_D153B8((int)&v9, "0023");
v4 = GameStatsManager::unlockSpecialChest(v3);
p_m_rightChest = &v9[-1].m_rightChest;
if ( &v9[-1].m_rightChest != (CCMenuItemSpriteExtra **)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_openLayer = (unsigned int *)&v9[-1].m_openLayer;
do
m_openLayer = __ldaxr(p_m_openLayer);
while ( __stlxr(m_openLayer - 1, p_m_openLayer) );
}
else
{
m_openLayer = (int)v9[-1].m_openLayer;
LODWORD(v9[-1].m_openLayer) = m_openLayer - 1;
}
if ( m_openLayer <= 0 )
operator delete(p_m_rightChest);
}
if ( v4 )
{
v6 = RewardUnlockLayer::create(v4->m_rewardType, nullptr);
a1->addChild_0(a1, v6, 100);
RewardUnlockLayer::showCollectReward(v6, v4);
}
}