//
// GJBaseGameLayer::updateMaxGameplayY from 0x476e30 to 0x476ebe (142 bytes)
//
// 2 xrefs:
// > PlayLayer::createObjectsFromSetupFinished @ 0x31ad1e
// > LevelEditorLayer::onPlaytest @ 0x36ea20
//
// 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 GJBaseGameLayer::updateMaxGameplayY(GJBaseGameLayer *a1)
{
LevelSettingsObject *m_levelSettings; // r0
cocos2d::CCArray *m_objects; // r3
cocos2d::ccArray *data; // r2
cocos2d::CCObject **arr; // r5
float v6; // s16
cocos2d::CCObject **v7; // r6
int v8; // r7
int v9; // t1
m_levelSettings = a1->m_levelSettings;
if ( m_levelSettings && LevelSettingsObject::shouldUseYSection(m_levelSettings) )
{
m_objects = a1->m_objects;
if ( m_objects && (data = m_objects->data, data->num) )
{
arr = data->arr;
v6 = 1200.0;
v7 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v7 )
{
v9 = (int)*arr++;
v8 = v9;
if ( !v9 )
break;
if ( *(float *)((*(int (__fastcall **)(int))(*(_DWORD *)v8 + 96))(v8) + 4) > v6 )
v6 = *(float *)((*(int (__fastcall **)(int))(*(_DWORD *)v8 + 96))(v8) + 4);
}
}
else
{
v6 = 1200.0;
}
a1->m_maxGameplayY = (float)(v6 + 90.0) + 300.0;
}
else
{
a1->m_maxGameplayY = 2790.0;
}
}