//
// EditorUI::deselectTargetPortals from 0x1401c83a0 to 0x1401c84fa (346 bytes)
//
// 7 xrefs:
// > EditorUI::onDelete @ 0x1401b0051
// > EditorUI::onDelete @ 0x1401b0138
// > EditorUI::onDeleteSelected @ 0x1401b0c31
// > ??> @ 0x1408a2cbc
// > ??> @ 0x1408a2cf0
// > ??> @ 0x14091a810
// > ??> @ 0x14091a81c
//
// 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 11:28:06 +0000
//
double __fastcall EditorUI::deselectTargetPortals(__int64 a1)
{
cocos2d::CCArray *v2; // rcx
__int64 v3; // rcx
unsigned int v4; // esi
cocos2d::CCArray *v5; // rbp
unsigned int i; // edi
struct cocos2d::CCObject *v7; // rax
struct cocos2d::CCObject *v8; // rax
__int64 v9; // rax
__int64 v10; // rcx
double result; // xmm0_8
v2 = *(cocos2d::CCArray **)(a1 + 944);
if ( v2 && cocos2d::CCArray::count(v2) )
{
v4 = 0;
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(v3);
for ( i = 0; i < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944)); ++i )
{
v7 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 944), i);
if ( *((_DWORD *)v7 + 259) == 749 )
cocos2d::CCArray::addObject(v5, v7);
}
if ( cocos2d::CCArray::count(v5) )
{
do
{
v8 = cocos2d::CCArray::objectAtIndex(v5, v4);
EditorUI::deselectObject(a1, (__int64)v8);
++v4;
}
while ( v4 < cocos2d::CCArray::count(v5) );
}
}
else
{
v9 = *(_QWORD *)(a1 + 1568);
if ( v9 && *(_DWORD *)(v9 + 1036) == 749 )
{
cocos2d::CCNode::stopActionByTag((cocos2d::CCNode *)a1, 124);
v10 = *(_QWORD *)(a1 + 1568);
if ( v10 )
{
*(_BYTE *)(v10 + 1141) = 0;
GameObject::updateObjectEditorColor(v10);
}
*(_QWORD *)(a1 + 1568) = 0;
EditorUI::toggleEditObjectButton(a1);
*(_BYTE *)(a1 + 824) = 1;
return cocos2d::CCPoint::operator=(a1 + 1544, &unk_14090A748);
}
}
return result;
}