//
// LevelEditorLayer::removeSpecial from 0x36a940 to 0x36abe6 (678 bytes)
//
// 6 xrefs:
// > LevelEditorLayer::removeObject @ 0x36ac34
// > LevelEditorLayer::handleAction @ 0x371736
// > LevelEditorLayer::handleAction @ 0x371792
// > LevelEditorLayer::refreshSpecial @ 0x3719be
// > EditorUI::createNewKeyframeAnim @ 0x3a35c4
// > EditorUI::onCreateObject @ 0x3a3d28
//
// 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 LevelEditorLayer::removeSpecial(LevelEditorLayer *a1, GameObject *a2)
{
int m_objectID; // r3
int v5; // r2
int v6; // r3
int v7; // r7
int v8; // s15
float m_fTrVertexMod; // r7
float v10; // s16
int v11; // r3
int v12; // r3
EffectGameObject *m_playbackObject; // r2
_BYTE v14[4]; // [sp+4h] [bp-18h] BYREF
float v15; // [sp+8h] [bp-14h]
_BYTE v16[4]; // [sp+Ch] [bp-10h] BYREF
float v17; // [sp+10h] [bp-Ch]
if ( !a2->m_isStartPos )
LevelEditorLayer::setObjectCount(a1, a1->m_objectCount.random - a1->m_objectCount.seed - 1);
m_objectID = a2->m_objectID;
if ( m_objectID == 1329 )
{
v7 = a1->m_coinCount.random - a1->m_coinCount.seed - 1;
a1->m_coinCount.value = v7;
v8 = (int)(float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0);
a1->m_coinCount.seed = v8;
a1->m_coinCount.random = v8 + v7;
}
else if ( m_objectID > 1329 )
{
if ( m_objectID == 2065 )
{
v6 = 11820;
}
else
{
v5 = 3032;
if ( m_objectID != 3032 )
goto LABEL_17;
GJBaseGameLayer::removeKeyframe(a1, (KeyframeGameObject *)a2);
v6 = 11824;
}
cocos2d::CCArray::removeObject(
*(cocos2d::CCArray **)((char *)&a1->GJBaseGameLayer::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v6),
a2,
1);
}
else
{
v5 = 747;
if ( m_objectID == 747 )
{
m_fTrVertexMod = a2[1].m_fTrVertexMod;
if ( m_fTrVertexMod != 0.0 )
{
cocos2d::CCObject::retain((cocos2d::CCObject *)LODWORD(a2[1].m_fTrVertexMod));
(*(void (__fastcall **)(_BYTE *, float))(*(_DWORD *)LODWORD(m_fTrVertexMod) + 900))(
v14,
COERCE_FLOAT(LODWORD(m_fTrVertexMod)));
v10 = v15;
a2->getStartPos((cocos2d::CCPoint *)v16, a2);
a2[1].m_fBrVertexMod = v10 - v17;
if ( !a1->m_removingAll )
LevelEditorLayer::removeObject(a1, (GameObject *)LODWORD(m_fTrVertexMod), 1);
a2[1].m_fTrVertexMod = 0.0;
cocos2d::CCObject::release((cocos2d::CCObject *)LODWORD(m_fTrVertexMod));
}
}
}
LABEL_17:
if ( a2->m_dontIgnoreDuration )
cocos2d::CCPoint::operator=(
(PlayerObject *)&a2[1].m_sQuad.br.vertices.y,
COERCE_FLOAT(&flt_AC5CF0),
v5,
a2->m_dontIgnoreDuration);
if ( a2->m_isTrigger )
DrawGridLayer::removeFromEffects(a1->m_drawGridLayer, (EffectGameObject *)a2);
if ( a2->m_classType == Effect )
LevelEditorLayer::tryUpdateSpeedObject(a1, (EffectGameObject *)a2, 1);
v11 = a2->m_objectID;
if ( v11 == 1814 )
goto LABEL_43;
if ( v11 > 1814 )
{
if ( v11 == 2067 )
goto LABEL_43;
if ( v11 > 2067 )
{
if ( v11 == 3016 )
goto LABEL_43;
if ( v11 == 3642 )
{
DrawGridLayer::removeAudioLineObject(a1->m_drawGridLayer, (AudioLineGuideGameObject *)a2);
goto LABEL_50;
}
if ( v11 != 2068 )
goto LABEL_47;
}
else if ( v11 != 1912 )
{
if ( v11 == 2016 )
{
v12 = 11816;
goto LABEL_49;
}
goto LABEL_47;
}
goto LABEL_45;
}
if ( v11 == 1007 )
{
v12 = 11804;
goto LABEL_49;
}
if ( v11 >= 1008 )
{
if ( v11 != 1268 )
{
if ( v11 < 1268 || (unsigned int)(v11 - 1346) > 1 )
goto LABEL_47;
LABEL_43:
v12 = 11812;
goto LABEL_49;
}
LABEL_45:
v12 = 11808;
goto LABEL_49;
}
if ( v11 == 901 )
goto LABEL_43;
if ( v11 == 1006 )
{
v12 = 11796;
goto LABEL_49;
}
LABEL_47:
if ( !GameObject::isColorTrigger(a2) )
goto LABEL_50;
v12 = 11800;
LABEL_49:
cocos2d::CCArray::removeObject(
*(cocos2d::CCArray **)((char *)&a1->GJBaseGameLayer::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v12),
a2,
1);
LABEL_50:
if ( a2->m_isSpawnOrderTrigger )
{
cocos2d::CCArray::removeObject(a1->m_spawnOrderObjects, a2, 1);
a1->m_spawnOrderObjectsChanged = 1;
}
if ( a2->m_activateTriggerInEditor || ((int (__fastcall *)(GameObject *))a2->isSpecialSpawnObject)(a2) )
cocos2d::CCArray::removeObject(a1->m_playtestTriggers, a2, 1);
if ( a2->m_dontIgnoreDuration )
cocos2d::CCArray::removeObject(a1->m_durationObjects, a2, 1);
m_playbackObject = a1->m_playbackObject;
if ( m_playbackObject && m_playbackObject->m_uniqueID == a2->m_uniqueID )
a1->m_playbackObject = nullptr;
cocos2d::CCArray::removeObject(a1->m_objects, a2, 1);
GJBaseGameLayer::removeFromGroupParents(a1, a2);
GJBaseGameLayer::removeFromGroups(a1, a2);
GJBaseGameLayer::removeFromStickyGroup(a1, a2);
a1->m_unk3b22 = 1;
}