Skip to content

Comments

Add two LSL Functions requested by #52#66

Open
zontreck wants to merge 12 commits intoOpenSim-NGC:dev-futurefrom
zontreck:fixes/zontreck/request_52
Open

Add two LSL Functions requested by #52#66
zontreck wants to merge 12 commits intoOpenSim-NGC:dev-futurefrom
zontreck:fixes/zontreck/request_52

Conversation

@zontreck
Copy link

As requested by #52, this PR aims to add two new functions: llReturnObjectsByID and llReturnObjectsByOwner.

@zontreck zontreck marked this pull request as draft November 15, 2023 23:47
Comment on lines 4714 to 4726
foreach (var sog in sogs)
{
if (sog is SceneObjectGroup sogx)
{

// If owner of SOG is [owner], return it.
if (sogx.OwnerID.ToString() == owner)
{
count++;
World.AddReturn(sogx.GroupID, sogx.Name, sogx.AbsolutePosition, "Object Owner Return");
}
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where

This foreach loop [implicitly filters its target sequence](1) - consider filtering the sequence explicitly using '.Where(...)'.
Comment on lines 4730 to 4747
foreach (var iParcel in parcels)
{
if (iParcel.OwnerID == m_host.OwnerID || IsEstateOwnerOrManager(m_host.OwnerID))
{
var sogs = iParcel.GetSceneObjectGroups();
foreach (var isog in sogs)
{
if (isog is SceneObjectGroup sog)
{
if (sog.OwnerID.ToString() == owner)
{
count++;
World.AddReturn(sog.GroupID, sog.Name, sog.AbsolutePosition, "Object Owner Return");
}
}
}
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where

This foreach loop [implicitly filters its target sequence](1) - consider filtering the sequence explicitly using '.Where(...)'.
@zontreck zontreck marked this pull request as ready for review May 14, 2024 08:36
}
}
}
catch (Exception e)

Check warning

Code scanning / CodeQL

Useless assignment to local variable

This assignment to [e](1) is useless, since its value is never read.
Comment on lines +4707 to +4715
foreach (SceneObjectGroup sog in World.GetSceneObjectGroups())
{
if (sog.OwnerID.ToString() == owner && !IsEstateOwnerOrManager(sog.OwnerID))
{
count++;
lSogs.Add(sog);

}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where

This foreach loop [implicitly filters its target sequence](1) - consider filtering the sequence explicitly using '.Where(...)'.
Comment on lines +4740 to +4750
foreach (var isog in sogs)
{
if (isog is SceneObjectGroup sog)
{
if (sog.OwnerID.ToString() == owner && !IsEstateOwnerOrManager(sog.OwnerID))
{
count++;
lSogs.Add(sog);
}
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where

This foreach loop [implicitly filters its target sequence](1) - consider filtering the sequence explicitly using '.Where(...)'.
@zontreck zontreck changed the title [DRAFT] Add two LSL Functions requested by #52 Add two LSL Functions requested by #52 May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add support for llReturnObjectsByID and llReturnObjectsByOwner

1 participant