//
// sub_1005B94E0 from 0x1005b94e0 to 0x1005b9631 (337 bytes)
//
// 3 xrefs:
// > EditorUI::onDeleteSelected @ 0x1000083e6
// > EditorUI::onDelete @ 0x10000cac2
// > EditorUI::onDelete @ 0x10000cdf8
//
// This function is hookable on this platform (idp: pc, 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 12:32:43 +0000
//
_QWORD *__fastcall sub_1005B94E0(__int64 a1)
{
__int64 v2; // rdi
__int64 v3; // r14
unsigned int v4; // r15d
__int64 v5; // rax
_QWORD *result; // rax
__int64 v7; // rdi
unsigned int v8; // r15d
__int64 v9; // rax
v2 = *(_QWORD *)(a1 + 896);
if ( v2 && (unsigned int)sub_1007FEF90(v2) )
{
v3 = sub_1007FE900(v2);
if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 896)) )
{
v4 = 0;
do
{
v5 = sub_1007FEFE0(*(_QWORD *)(a1 + 896), v4);
if ( *(_DWORD *)(v5 + 1028) == 749 )
sub_1007FEBF0(v3, v5);
++v4;
}
while ( v4 < (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 896)) );
}
result = (_QWORD *)sub_1007FEF90(v3);
if ( (_DWORD)result )
{
v8 = 0;
do
{
v9 = sub_1007FEFE0(v3, v8);
EditorUI::deselectObject(a1, v9);
++v8;
result = (_QWORD *)sub_1007FEF90(v3);
}
while ( v8 < (unsigned int)result );
}
}
else
{
result = *(_QWORD **)(a1 + 1496);
if ( result && *((_DWORD *)result + 257) == 749 )
{
cocos2d::CCNode::stopActionByTag(a1, 124);
v7 = *(_QWORD *)(a1 + 1496);
if ( v7 )
GameObject::deselectObject(v7);
*(_QWORD *)(a1 + 1496) = 0;
EditorUI::toggleEditObjectButton(a1);
*(_BYTE *)(a1 + 776) = 1;
return sub_100278300((_QWORD *)(a1 + 1472), &qword_100BE58D0);
}
}
return result;
}